upload nach _files

This commit is contained in:
Troy grunt
2026-02-13 22:11:55 +01:00
parent ae21c3c5d8
commit 376bfdeafe
4 changed files with 12 additions and 12 deletions

View File

@@ -51,10 +51,10 @@ if (!$file) {
/**
* Dateipfad
*/
$basePath = '/var/www/files/';
$path = realpath($basePath . $file['stored_name']);
$basePath = realpath(__DIR__ . '/_files');
$path = $basePath ? realpath($basePath . '/' . $file['stored_name']) : null;
if (!$path || !str_starts_with($path, $basePath) || !is_file($path)) {
if (!$path || !$basePath || !str_starts_with($path, $basePath) || !is_file($path)) {
http_response_code(404);
exit('Datei fehlt');
}