X-Git-Url: http://git.cyclocoop.org//%22javascript:ModifierStyle%28%27%22.%24id.%22%27%29/%22?a=blobdiff_plain;f=includes%2Fupload%2FUploadBase.php;h=5352d95b8de97338efd26024388aaa36c2b57b38;hb=6e956d55aac4e4d7e6145ed51c44311ca0e9b0c7;hp=ddb4bbafdc2328ec849a0a66b4bebcc621fe30c7;hpb=a18476eab39dc201384c68cbd27228c5af32f7fc;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php index ddb4bbafdc..5352d95b8d 100644 --- a/includes/upload/UploadBase.php +++ b/includes/upload/UploadBase.php @@ -854,7 +854,7 @@ abstract class UploadBase { if ( !is_array( $error ) ) { $error = [ $error ]; } - return call_user_func_array( 'Status::newFatal', $error ); + return Status::newFatal( ...$error ); } $status = $this->getLocalFile()->upload( @@ -1063,7 +1063,7 @@ abstract class UploadBase { if ( !$isPartial ) { $error = $this->runUploadStashFileHook( $user ); if ( $error ) { - return call_user_func_array( 'Status::newFatal', $error ); + return Status::newFatal( ...$error ); } } try { @@ -1397,7 +1397,7 @@ abstract class UploadBase { */ public static function checkXMLEncodingMissmatch( $file ) { global $wgSVGMetadataCutoff; - $contents = file_get_contents( $file, false, null, -1, $wgSVGMetadataCutoff ); + $contents = file_get_contents( $file, false, null, 0, $wgSVGMetadataCutoff ); $encodingRegex = '!encoding[ \t\n\r]*=[ \t\n\r]*[\'"](.*?)[\'"]!si'; if ( preg_match( "!<\?xml\b(.*?)\?>!si", $contents, $matches ) ) { @@ -1425,9 +1425,9 @@ abstract class UploadBase { // detect the encoding in case is specifies an encoding not whitelisted in self::$safeXmlEncodings $attemptEncodings = [ 'UTF-16', 'UTF-16BE', 'UTF-32', 'UTF-32BE' ]; foreach ( $attemptEncodings as $encoding ) { - MediaWiki\suppressWarnings(); + Wikimedia\suppressWarnings(); $str = iconv( $encoding, 'UTF-8', $contents ); - MediaWiki\restoreWarnings(); + Wikimedia\restoreWarnings(); if ( $str != '' && preg_match( "!<\?xml\b(.*?)\?>!si", $str, $matches ) ) { if ( preg_match( $encodingRegex, $matches[1], $encMatch ) && !in_array( strtoupper( $encMatch[1] ), self::$safeXmlEncodings ) @@ -1864,8 +1864,7 @@ abstract class UploadBase { # look up scanner configuration $command = $wgAntivirusSetup[$wgAntivirus]['command']; $exitCodeMap = $wgAntivirusSetup[$wgAntivirus]['codemap']; - $msgPattern = isset( $wgAntivirusSetup[$wgAntivirus]['messagepattern'] ) ? - $wgAntivirusSetup[$wgAntivirus]['messagepattern'] : null; + $msgPattern = $wgAntivirusSetup[$wgAntivirus]['messagepattern'] ?? null; if ( strpos( $command, "%f" ) === false ) { # simple pattern: append file to scan