Line: 68 f.

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.
This commit is contained in:
David 2014-04-23 20:22:53 +02:00
parent f38306e20b
commit 44beff1a9a

View file

@ -65,6 +65,18 @@ function wall_attach_post(&$a) {
$maxfilesize = get_config('system','maxfilesize'); $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)) { if(($maxfilesize) && ($filesize > $maxfilesize)) {
notice( sprintf(t('File exceeds size limit of %d'), $maxfilesize) . EOL); notice( sprintf(t('File exceeds size limit of %d'), $maxfilesize) . EOL);
@unlink($src); @unlink($src);