From: Brian Wolff Date: Tue, 27 Dec 2011 02:57:25 +0000 (+0000) Subject: (bug 31719) Apply Derk-Jan Hartman's patch to make '&ns_svg;' considered a namespace... X-Git-Tag: 1.31.0-rc.0~25726 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=commitdiff_plain;h=079ae7594e8b3c4fa43975a6c263b43edef6960b;p=lhc%2Fweb%2Fwiklou.git (bug 31719) Apply Derk-Jan Hartman's patch to make '&ns_svg;' considered a namespace for svg files. Work around issue where entities not expanded by our SVGMetadataReader. I'm leaving the bug open, since I'm not sure if this is a proper fix, but I think its significantly better than the current situation. --- diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index f279555c97..182ef6d934 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -198,6 +198,7 @@ production. cssText after DOM insertion. * (bug 30711) When adding a new section to a page with section=new, the text is now always added to the current version of the page +* (bug 31719) Recognize &ns_svg; as the svg namespace when extracting width === API changes in 1.19 === * (bug 19838) siprop=interwikimap can now use the interwiki cache. diff --git a/includes/media/SVGMetadataExtractor.php b/includes/media/SVGMetadataExtractor.php index f20482b4c7..1da5b94af5 100644 --- a/includes/media/SVGMetadataExtractor.php +++ b/includes/media/SVGMetadataExtractor.php @@ -36,6 +36,7 @@ class SVGReader { const DEFAULT_WIDTH = 512; const DEFAULT_HEIGHT = 512; const NS_SVG = 'http://www.w3.org/2000/svg'; + const ADOBE_SVG_ENTITY = '&ns_svg;'; private $reader = null; private $mDebug = false; @@ -102,7 +103,10 @@ class SVGReader { $keepReading = $this->reader->read(); } - if ( $this->reader->localName != 'svg' || $this->reader->namespaceURI != self::NS_SVG ) { + # Note, entities not expanded in namespaceURI - bug 31719 + if ( $this->reader->localName != 'svg' || + ( $this->reader->namespaceURI != self::NS_SVG && + $this->reader->namespaceURI != self::ADOBE_SVG_ENTITY ) ) { throw new MWException( "Expected tag, got ". $this->reader->localName . " in NS " . $this->reader->namespaceURI ); }