diff --git a/assets/images/profilePictures/user_10_69769485461a7618397775.jpg b/assets/images/profilePictures/user_10_69769485461a7618397775.jpg new file mode 100644 index 0000000..20da055 Binary files /dev/null and b/assets/images/profilePictures/user_10_69769485461a7618397775.jpg differ diff --git a/upload.php b/upload.php index 1878784..ab33f56 100644 --- a/upload.php +++ b/upload.php @@ -106,10 +106,10 @@ if (!is_writable($targetDir)) exit(); } -// Fallback-kompatibler Name (auch ohne random_bytes) -$rand = uniqid('', true); -$rand = str_replace('.', '', $rand); -$filename = 'user_' . $userId . '_' . $rand . '.' . $ext; +// Dateiname: user__. +// Format ist dateisystem-sicher (keine Doppelpunkte) und eindeutig genug. +$timestamp = gmdate('Ymd-His'); +$filename = 'user_' . $userId . '_' . $timestamp . '.' . $ext; $targetPath = rtrim($targetDir, "\\/") . DIRECTORY_SEPARATOR . $filename; if (!move_uploaded_file($tmp, $targetPath))