X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FWebRequestUpload.php;h=c2d08b87fa4c7436c4a6391cd1c8b5a69ef6c0d8;hb=f78e39d3d70d5ac299e33c85cc1af73f8f739607;hp=0881a16fca502daaa19350406c21ad406cb01b86;hpb=f71de180a3f22a11df1ad1c8c8abd83580be19b5;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/WebRequestUpload.php b/includes/WebRequestUpload.php index 0881a16fca..c2d08b87fa 100644 --- a/includes/WebRequestUpload.php +++ b/includes/WebRequestUpload.php @@ -20,6 +20,8 @@ * @file */ +use MediaWiki\MediaWikiServices; + /** * Object to access the $_FILES array * @@ -63,13 +65,12 @@ class WebRequestUpload { return null; } - global $wgContLang; $name = $this->fileInfo['name']; # Safari sends filenames in HTML-encoded Unicode form D... # Horrid and evil! Let's try to make some kind of sense of it. $name = Sanitizer::decodeCharReferences( $name ); - $name = $wgContLang->normalize( $name ); + $name = MediaWikiServices::getInstance()->getContentLanguage()->normalize( $name ); wfDebug( __METHOD__ . ": {$this->fileInfo['name']} normalized to '$name'\n" ); return $name; } @@ -102,7 +103,7 @@ class WebRequestUpload { /** * Return the upload error. See link for explanation - * http://www.php.net/manual/en/features.file-upload.errors.php + * https://www.php.net/manual/en/features.file-upload.errors.php * * @return int One of the UPLOAD_ constants, 0 if non-existent */ @@ -126,7 +127,7 @@ class WebRequestUpload { return true; } - $contentLength = $this->request->getHeader( 'CONTENT-LENGTH' ); + $contentLength = $this->request->getHeader( 'Content-Length' ); $maxPostSize = wfShorthandToInteger( ini_get( 'post_max_size' ) ?: ini_get( 'hhvm.server.max_post_size' ), 0