X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FWebRequestUpload.php;h=916a10c9f0777e71f9b34f583da1a833bae944e2;hb=2ec7dbb4892cef0a75ac05304b6ac7779a3835c4;hp=e743d9de166116b9b89849dee0a34722017d3990;hpb=c86d36805ed741ef3ebd0c35f6cd12271c454101;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/WebRequestUpload.php b/includes/WebRequestUpload.php index e743d9de16..916a10c9f0 100644 --- a/includes/WebRequestUpload.php +++ b/includes/WebRequestUpload.php @@ -102,7 +102,7 @@ class WebRequestUpload { /** * Return the upload error. See link for explanation - * http://www.php.net/manual/en/features.file-upload.errors.php + * https://secure.php.net/manual/en/features.file-upload.errors.php * * @return int One of the UPLOAD_ constants, 0 if non-existent */ @@ -126,8 +126,13 @@ class WebRequestUpload { return true; } - $contentLength = $this->request->getHeader( 'CONTENT_LENGTH' ); - if ( $contentLength > wfShorthandToInteger( ini_get( 'post_max_size' ) ) ) { + $contentLength = $this->request->getHeader( 'Content-Length' ); + $maxPostSize = wfShorthandToInteger( + ini_get( 'post_max_size' ) ?: ini_get( 'hhvm.server.max_post_size' ), + 0 + ); + + if ( $maxPostSize && $contentLength > $maxPostSize ) { # post_max_size is exceeded return true; }