diff options
author | steckbrief <steckbrief@chefmail.de> | 2017-12-25 22:35:35 +0100 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2017-12-25 22:35:35 +0100 |
commit | d87f45b828cf0d2eeb8a641b411bbf210aba36b1 (patch) | |
tree | 821c25b2970445b09b6c5cf4d6c0056d10b4b0e7 | |
parent | 39b7f245baadecbc3aad47e0273ce933ef3acc00 (diff) |
adding better check for uploaded file
Diffstat (limited to '')
-rw-r--r-- | lib/functions.stories.inc.php | 4 |
1 files changed, 3 insertions, 1 deletions
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 |