When trying to upload a file greater than PHP's max_upload_filesize,
the filesize is 0, and maybe some html code appears in the
text input window of the form. Problem seems to disappear
when refusing all uploads if filesize <=0.
$maxfilesize = get_config('system','maxfilesize');
+ /* Found html code written in text field of form,
+ * when trying to upload a file with filesize
+ * greater than upload_max_filesize. Cause is unknown.
+ * Then Filesize gets <= 0.
+ */
+
+ if($filesize <=0) {
+ notice(t('$filesize <= 0; upload refused') . EOL);
+ @unlink($src);
+ killme();
+ }
+
if(($maxfilesize) && ($filesize > $maxfilesize)) {
notice( sprintf(t('File exceeds size limit of %d'), $maxfilesize) . EOL);
@unlink($src);