From 3a17a957cbcf1cb2488fc694210f242a8e95af79 Mon Sep 17 00:00:00 2001 From: Fabian Schieder Date: Sun, 25 Jan 2026 23:05:38 +0100 Subject: [PATCH] Refactor error handling in file upload process to suppress error display in browser and enhance server-side logging --- upload.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/upload.php b/upload.php index 1acf1ff..d3a9a47 100644 --- a/upload.php +++ b/upload.php @@ -1,7 +1,8 @@ file($tmp); if (!$mime || !isset($allowedMimeToExt[$mime])) { + // Mime loggen ist ok (kein Secret), hilft bei Support error_log('Upload: invalid mime=' . (string)$mime); header('Location: account.php?upload=err&code=mime'); exit(); @@ -83,8 +87,6 @@ if ($docTargetDir !== '' && !is_dir($dirTargetDir) && is_dir($docTargetDir)) $targetDir = $docTargetDir; } -error_log('Upload: resolved targetDir=' . $targetDir . ' (DOCUMENT_ROOT=' . $documentRoot . ', __DIR__=' . __DIR__ . ')'); - if (!is_dir($targetDir)) { $mkOk = @mkdir($targetDir, 0755, true);