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

@@ -287,7 +287,7 @@ if ($action === 'identity_edit') {
}
if ($filesInput && $hasSelection) {
$uploadDir = __DIR__ . '/../files/';
$uploadDir = __DIR__ . '/_files/';
if (!is_dir($uploadDir) && !mkdir($uploadDir, 0755, true) && !is_dir($uploadDir)) {
$fileUploadErrors[] = 'Upload-Verzeichnis kann nicht erstellt werden.';
} else {

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');
}