Add accessor to $rootElement, rather than accessing it directly.
authorChad Horohoe <demon@users.mediawiki.org>
Fri, 19 Sep 2008 13:39:30 +0000 (13:39 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Fri, 19 Sep 2008 13:39:30 +0000 (13:39 +0000)
includes/MimeMagic.php
includes/XmlTypeCheck.php

index 8f903a8..b21ff54 100644 (file)
@@ -460,8 +460,8 @@ class MimeMagic {
                $xml = new XmlTypeCheck( $file );
                if( $xml->wellFormed ) {
                        global $wgXMLMimeTypes;
-                       if( isset( $wgXMLMimeTypes[$xml->rootElement] ) ) {
-                               return $wgXMLMimeTypes[$xml->rootElement];
+                       if( isset( $wgXMLMimeTypes[$xml->getRootElement()] ) ) {
+                               return $wgXMLMimeTypes[$xml->getRootElement()];
                        } else {
                                return 'application/xml';
                        }
index 09b8c20..10a0854 100644 (file)
@@ -28,6 +28,13 @@ class XmlTypeCheck {
                $this->softNamespaces = $softNamespaces;
                $this->run( $file );
        }
+       
+       /**
+        * Get the root element. Simple accessor to $rootElement
+        */
+       public function getRootElement() {
+               return $this->rootElement;
+       }
 
        private function run( $fname ) {
                if( $this->softNamespaces ) {