From: David Date: Wed, 23 Apr 2014 18:22:53 +0000 (+0200) Subject: Line: 68 f. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=44beff1a9afa737e8c29fe4aec2526369e943962;p=friendica.git 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. --- diff --git a/mod/wall_attach.php b/mod/wall_attach.php index 8a355d6831..ad391856f0 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);