r107792 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107791‎ | r107792 | r107793 >
Date:00:07, 2 January 2012
Author:tstarling
Status:ok (Comments)
Tags:
Comment:
MFT r107359: fix Adobe Illustrator SVGs presumably broken by a PHP upgrade
Modified paths:
  • /branches/wmf/1.18wmf1/includes/media/SVGMetadataExtractor.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/includes/media/SVGMetadataExtractor.php
@@ -36,6 +36,7 @@
3737 const DEFAULT_WIDTH = 512;
3838 const DEFAULT_HEIGHT = 512;
3939 const NS_SVG = 'http://www.w3.org/2000/svg';
 40+ const ADOBE_SVG_ENTITY = '&ns_svg;';
4041
4142 private $reader = null;
4243 private $mDebug = false;
@@ -102,7 +103,10 @@
103104 $keepReading = $this->reader->read();
104105 }
105106
106 - if ( $this->reader->localName != 'svg' || $this->reader->namespaceURI != self::NS_SVG ) {
 107+ # Note, entities not expanded in namespaceURI - bug 31719
 108+ if ( $this->reader->localName != 'svg' ||
 109+ ( $this->reader->namespaceURI != self::NS_SVG &&
 110+ $this->reader->namespaceURI != self::ADOBE_SVG_ENTITY ) ) {
107111 throw new MWException( "Expected <svg> tag, got ".
108112 $this->reader->localName . " in NS " . $this->reader->namespaceURI );
109113 }
Property changes on: branches/wmf/1.18wmf1/includes/media/SVGMetadataExtractor.php
___________________________________________________________________
Added: svn:mergeinfo
110114 Merged /branches/new-installer/phase3/includes/media/SVGMetadataExtractor.php:r43664-66004
111115 Merged /branches/wmf-deployment/includes/media/SVGMetadataExtractor.php:r53381
112116 Merged /branches/REL1_15/phase3/includes/media/SVGMetadataExtractor.php:r51646
113117 Merged /branches/wmf/1.18wmf1/includes/media/SVGMetadataExtractor.php:r107359
114118 Merged /branches/sqlite/includes/media/SVGMetadataExtractor.php:r58211-58321
115119 Merged /trunk/phase3/includes/media/SVGMetadataExtractor.php:r92580,92634,92713,92762,92765,92791,92854,92884,92886-92887,92894,92898,92907,92932,92958,93141,93149,93151,93233-93234,93258,93266,93303,93516-93518,93818-93822,93847,93858,93891,93935-93936,94058,94062,94068,94107,94155,94235,94277,94346,94372,94422,94425,94444,94448,94456,94498,94517,94601,94630,94728,94738,94825,94862,94995-94997,95023,95042,95072-95073,95155,95327,95332,95410,95422,95426,95442,95468,95601,95812,97810,98578,98598,98656,99477,99694,100572,100575,101291,101802,101860,101990,102297,102334-102335,102440,107359

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r107359(bug 31719) Apply Derk-Jan Hartman's patch to make '&ns_svg;' considered a na...bawolff02:57, 27 December 2011

Comments

#Comment by 😂 (talk | contribs)   18:20, 9 January 2012

r107359 was reverted in favor of r107793. Should the same happen in 1.18wmf1?

#Comment by Tim Starling (talk | contribs)   03:46, 16 January 2012

I think it is OK to wait for 1.19 to be deployed, unless there is a report of SVGs in the wild that are fixed by r107793.

Status & tagging log