check whether there was an image upload at all

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2021-07-13 09:01:22 +02:00
parent 3b6792d548
commit 35cd567c48

View File

@@ -375,7 +375,7 @@ class Store
$path = \Froxlor\Froxlor::getInstallDir().'/img/';
// New file?
if ($_FILES[$fieldname]['tmp_name']) {
if (isset($_FILES[$fieldname]) && $_FILES[$fieldname]['tmp_name']) {
// Make sure upload directory exists
if (!is_dir($path) && !mkdir($path, '0775')) {
throw new \Exception("img directory does not exist and cannot be created");