From: Chad Horohoe Date: Fri, 19 Sep 2008 13:39:30 +0000 (+0000) Subject: Add accessor to $rootElement, rather than accessing it directly. X-Git-Tag: 1.31.0-rc.0~45219 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/supprimer.php?a=commitdiff_plain;h=b042f2c8350b0edb15036caa8f6731ec1185bf1d;p=lhc%2Fweb%2Fwiklou.git Add accessor to $rootElement, rather than accessing it directly. --- diff --git a/includes/MimeMagic.php b/includes/MimeMagic.php index 8f903a8fdb..b21ff540e2 100644 --- a/includes/MimeMagic.php +++ b/includes/MimeMagic.php @@ -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'; } diff --git a/includes/XmlTypeCheck.php b/includes/XmlTypeCheck.php index 09b8c20ad7..10a08547fb 100644 --- a/includes/XmlTypeCheck.php +++ b/includes/XmlTypeCheck.php @@ -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 ) {