From 44beff1a9afa737e8c29fe4aec2526369e943962 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 23 Apr 2014 20:22:53 +0200 Subject: [PATCH] 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. --- mod/wall_attach.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mod/wall_attach.php b/mod/wall_attach.php index 8a355d683..ad391856f 100644 --- a/mod/wall_attach.php +++ b/mod/wall_attach.php @@ -65,6 +65,18 @@ function wall_attach_post(&$a) { $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);