fix: prevent creating empty cover image extensions when editing a mod
This commit is contained in:
parent
bfc78bbc37
commit
032148ccf8
1 changed files with 1 additions and 1 deletions
|
@ -75,7 +75,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
$fileExtension = str_replace(['/', '\\'], '', $modDataToEdit['image_ext']);
|
||||
$fileExtension = $modDataToEdit['image_ext'] ? str_replace(['/', '\\'], '', $modDataToEdit['image_ext']) : null;
|
||||
$liveCoverImagePathname = $modUploadDirectory . '/' . str_replace(['/', '\\'], '', $modDataToEdit['slug']) . '.' . $fileExtension;
|
||||
if (file_exists($liveCoverImagePathname)) {
|
||||
if (!file_exists($modPendingUploadDirectory) && !mkdir($modPendingUploadDirectory, 0777, true)) {
|
||||
|
|
Loading…
Reference in a new issue