dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Remove references to Popularpages alias"
[lhc/web/wiklou.git]
/
includes
/
MimeMagic.php
diff --git
a/includes/MimeMagic.php
b/includes/MimeMagic.php
index
ebe98a3
..
2b240c3
100644
(file)
--- a/
includes/MimeMagic.php
+++ b/
includes/MimeMagic.php
@@
-617,16
+617,18
@@
class MimeMagic {
/**
* Guess the MIME type from the file contents.
*
/**
* Guess the MIME type from the file contents.
*
+ * @todo Remove $ext param
+ *
* @param string $file
* @param mixed $ext
* @return bool|string
* @throws MWException
*/
* @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
// Read a chunk of the file
-
wfS
uppressWarnings();
+
MediaWiki\s
uppressWarnings();
$f = fopen( $file, 'rb' );
$f = fopen( $file, 'rb' );
-
wfR
estoreWarnings();
+
MediaWiki\r
estoreWarnings();
if ( !$f ) {
return 'unknown/unknown';
if ( !$f ) {
return 'unknown/unknown';
@@
-693,7
+695,7
@@
class MimeMagic {
}
/* Look for WebP */
}
/* 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";
}
wfDebug( __METHOD__ . ": recognized file as image/webp\n" );
return "image/webp";
}
@@
-780,9
+782,9
@@
class MimeMagic {
return $this->detectZipType( $head, $tail, $ext );
}
return $this->detectZipType( $head, $tail, $ext );
}
-
wfS
uppressWarnings();
+
MediaWiki\s
uppressWarnings();
$gis = getimagesize( $file );
$gis = getimagesize( $file );
-
wfR
estoreWarnings();
+
MediaWiki\r
estoreWarnings();
if ( $gis && isset( $gis['mime'] ) ) {
$mime = $gis['mime'];
if ( $gis && isset( $gis['mime'] ) ) {
$mime = $gis['mime'];