*/
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;
/**
case 'png':
return 'image/png';
case 'jpg':
- return 'image/jpeg';
case 'jpeg':
return 'image/jpeg';
}
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.