summaryrefslogtreecommitdiff
path: root/lib/imagefile.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2009-11-02 09:08:26 -0800
committerBrion Vibber <brion@pobox.com>2009-11-02 09:10:06 -0800
commit73b9e531bf7cab8ba6642f9cb85e4b37b48706d7 (patch)
tree959e449179b9f4254209888af8d5c2eca0cd3991 /lib/imagefile.php
parentb579a306c7449cc5cd3a6c2a8f729c1e828ee0c3 (diff)
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.
Diffstat (limited to 'lib/imagefile.php')
-rw-r--r--lib/imagefile.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/imagefile.php b/lib/imagefile.php
index 88f461481..cd2f87e6b 100644
--- a/lib/imagefile.php
+++ b/lib/imagefile.php
@@ -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;
}