fix: fix missing mod image after submitting the mod

This commit is contained in:
Dorian Niemiec 2025-01-20 23:50:49 +01:00
parent 85b235e047
commit 41f067f10a

View file

@ -104,7 +104,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$errorMessage = "An unexpected error occurred while uploading the cover image.";
}
if (!$fileError) {
$uploadedCoverImagePathname = $modPendingUploadDirectory . '/' . str_replace(['/', '\\'], '', $modDataToEdit['slug']) . '.' . $fileExtension;
$uploadedCoverImagePathname = $modPendingUploadDirectory . '/' . str_replace(['/', '\\'], '', $slug) . '.' . $fileExtension;
if (!move_uploaded_file($fileTmpPath, $uploadedCoverImagePathname)) {
$fileError = true;
$errorMessage = "An unexpected error occurred while uploading the cover image.";
@ -255,4 +255,4 @@ if ($modSubmitted) {
sendEmail($moderators, 'A mod has been submitted that requires approval', "A mod has been submitted that requires approval:\n\nMod name: " . str_replace(["\r\n", "\r", "\n"], '', $_POST['name']) . "\nSlug: " . $slug . "\n\nPlease review the mod and approve or reject it.");
}
}
?>
?>