Merge "filebackend: Use HTTPFileStreamer::send404Message() in caller instead"
[lhc/web/wiklou.git] / includes / StreamFile.php
index 71113a8..2afd651 100644 (file)
  */
 class StreamFile {
        // Do not send any HTTP headers unless requested by caller (e.g. body only)
+       /** @deprecated since 1.34 */
        const STREAM_HEADLESS = HTTPFileStreamer::STREAM_HEADLESS;
        // Do not try to tear down any PHP output buffers
+       /** @deprecated since 1.34 */
        const STREAM_ALLOW_OB = HTTPFileStreamer::STREAM_ALLOW_OB;
 
        /**
@@ -105,7 +107,6 @@ class StreamFile {
                                case 'png':
                                        return 'image/png';
                                case 'jpg':
-                                       return 'image/jpeg';
                                case 'jpeg':
                                        return 'image/jpeg';
                        }
@@ -113,7 +114,7 @@ class StreamFile {
                        return 'unknown/unknown';
                }
 
-               $magic = MimeMagic::singleton();
+               $magic = MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer();
                // Use the extension only, rather than magic numbers, to avoid opening
                // up vulnerabilities due to uploads of files with allowed extensions
                // but disallowed types.