Detect "no file" upload error and, for now at least, ignore it gracefully.
This was triggering on non-AJAX form submissions for new notices, preventing them from being posted when they contained no attachments.
This commit is contained in:
@@ -79,7 +79,12 @@ class ImageFile
|
||||
@unlink($_FILES[$param]['tmp_name']);
|
||||
throw new Exception(_('Partial upload.'));
|
||||
return;
|
||||
case UPLOAD_ERR_NO_FILE:
|
||||
// No file; probably just a non-AJAX submission.
|
||||
return;
|
||||
default:
|
||||
common_log(LOG_ERR, __METHOD__ . ": Unknown upload error " .
|
||||
$_FILES[$param]['error']);
|
||||
throw new Exception(_('System error uploading file.'));
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user