summaryrefslogtreecommitdiff
path: root/includes/MimeMagic.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2008-12-15 18:02:47 +0100
committerPierre Schmitz <pierre@archlinux.de>2008-12-15 18:02:47 +0100
commit396b28f3d881f5debd888ba9bb9b47c2d478a76f (patch)
tree10d6e1a721ee4ef69def34a57f02d7eb3fc9e31e /includes/MimeMagic.php
parent0be4d3ccf6c4fe98a72704f9463ecdea2ee5e615 (diff)
update to Mediawiki 1.13.3; some cleanups
Diffstat (limited to 'includes/MimeMagic.php')
-rw-r--r--includes/MimeMagic.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/includes/MimeMagic.php b/includes/MimeMagic.php
index ec4505ab..e33b1c0a 100644
--- a/includes/MimeMagic.php
+++ b/includes/MimeMagic.php
@@ -100,6 +100,10 @@ class MimeMagic {
*/
var $mExtToMime= NULL;
+ /** IEContentAnalyzer instance
+ */
+ var $mIEAnalyzer;
+
/** The singleton instance
*/
private static $instance;
@@ -726,4 +730,27 @@ class MimeMagic {
return MEDIATYPE_UNKNOWN;
}
+
+ /**
+ * Get the MIME types that various versions of Internet Explorer would
+ * detect from a chunk of the content.
+ *
+ * @param string $fileName The file name (unused at present)
+ * @param string $chunk The first 256 bytes of the file
+ * @param string $proposed The MIME type proposed by the server
+ */
+ public function getIEMimeTypes( $fileName, $chunk, $proposed ) {
+ $ca = $this->getIEContentAnalyzer();
+ return $ca->getRealMimesFromData( $fileName, $chunk, $proposed );
+ }
+
+ /**
+ * Get a cached instance of IEContentAnalyzer
+ */
+ protected function getIEContentAnalyzer() {
+ if ( is_null( $this->mIEAnalyzer ) ) {
+ $this->mIEAnalyzer = new IEContentAnalyzer;
+ }
+ return $this->mIEAnalyzer;
+ }
}