upload nach _files
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user