X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2FWebRequestUpload.php;h=c741907d3eebddf9de70c8838b2fbdb41f2ddea2;hp=e743d9de166116b9b89849dee0a34722017d3990;hb=e3bd13db0c285f312e31bb1b7271af4628cca80c;hpb=c86d36805ed741ef3ebd0c35f6cd12271c454101 diff --git a/includes/WebRequestUpload.php b/includes/WebRequestUpload.php index e743d9de16..c741907d3e 100644 --- a/includes/WebRequestUpload.php +++ b/includes/WebRequestUpload.php @@ -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; }