From d87f45b828cf0d2eeb8a641b411bbf210aba36b1 Mon Sep 17 00:00:00 2001 From: steckbrief Date: Mon, 25 Dec 2017 22:35:35 +0100 Subject: adding better check for uploaded file --- lib/functions.stories.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/functions.stories.inc.php b/lib/functions.stories.inc.php index b882869..5e0527e 100644 --- a/lib/functions.stories.inc.php +++ b/lib/functions.stories.inc.php @@ -22,8 +22,10 @@ function createEntity($path, $description, $file, $filename) { // Error on writing description file } // move uploaded logo - if (NULL === $file || move_uploaded_file($file['tmp_name'], $path.DIRECTORY_SEPARATOR.$filename)) { + if (NULL === $file || move_uploaded_file($file['tmp_name'], $path.DIRECTORY_SEPARATOR.$filename) || $file['error'] == UPLOAD_ERR_NO_FILE) { return TRUE; + } else { + return 3; } } else { // Error on directory creation -- cgit v1.2.3