Merge "Http::getProxy() method to get proxy configuration"
[lhc/web/wiklou.git] / includes / WebRequestUpload.php
index e743d9d..c741907 100644 (file)
@@ -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;
                }