- $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 ) {