From 391f9332e286020f4e1358953a99b81cfb5b79be Mon Sep 17 00:00:00 2001 From: Fabian Schieder Date: Sun, 25 Jan 2026 22:59:31 +0100 Subject: [PATCH] Refactor target directory path handling for profile picture uploads to correct directory structure --- upload.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/upload.php b/upload.php index b42bc7d..3662b46 100644 --- a/upload.php +++ b/upload.php @@ -65,8 +65,8 @@ $ext = $allowedMimeToExt[$mime]; $documentRoot = isset($_SERVER['DOCUMENT_ROOT']) ? (string)$_SERVER['DOCUMENT_ROOT'] : ''; $webRoot = rtrim($documentRoot, "\\/"); $targetDir = $webRoot !== '' - ? $webRoot . '/FSST/Website' - : __DIR__ . '/FSST/Website/assets/images/profilePictures'; + ? $webRoot . 'assets/images/profilePictures' + : __DIR__ . 'assets/images/profilePictures'; if (!is_dir($targetDir)) { @@ -97,7 +97,7 @@ if (!move_uploaded_file($tmp, $targetPath)) $lastErr = error_get_last(); $lastErrMsg = (is_array($lastErr) && isset($lastErr['message'])) ? (string)$lastErr['message'] : 'unknown'; error_log('Upload: move_uploaded_file failed to ' . $targetPath . ' - ' . $lastErrMsg); - header('Location: account.php?upload=err'); + header('Location: account.php?upload=err&code=move'); exit(); }