X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FMimeMagic.php;h=2b240c3b02b45e19002450442450ca1b6d116337;hb=2a98737a0f59d25b5d3830050d5963b2ad7dab48;hp=0d907b7e31562c8a1e10f5c1eb2d1f4994ca5352;hpb=3247aa820273258a6927ba0b9b165e6913476e7a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/MimeMagic.php b/includes/MimeMagic.php index 0d907b7e31..2b240c3b02 100644 --- a/includes/MimeMagic.php +++ b/includes/MimeMagic.php @@ -617,12 +617,14 @@ class MimeMagic { /** * Guess the MIME type from the file contents. * + * @todo Remove $ext param + * * @param string $file * @param mixed $ext * @return bool|string * @throws MWException */ - private function doGuessMimeType( $file, $ext ) { // TODO: remove $ext param + private function doGuessMimeType( $file, $ext ) { // Read a chunk of the file MediaWiki\suppressWarnings(); $f = fopen( $file, 'rb' ); @@ -693,7 +695,7 @@ class MimeMagic { } /* Look for WebP */ - if ( strncmp( $head, "RIFF", 4 ) == 0 && strncmp( substr( $head, 8, 8 ), "WEBPVP8 ", 8 ) == 0 ) { + if ( strncmp( $head, "RIFF", 4 ) == 0 && strncmp( substr( $head, 8, 7 ), "WEBPVP8", 7 ) == 0 ) { wfDebug( __METHOD__ . ": recognized file as image/webp\n" ); return "image/webp"; }