http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88870
Revision: 88870
Author: brion
Date: 2011-05-25 23:57:44 +0000 (Wed, 25 May 2011)
Log Message:
-----------
Reverting r82307 (bug 27465) as initial step to recommitting a cleaner fix.
Modified Paths:
--------------
trunk/phase3/includes/media/SVGMetadataExtractor.php
Modified: trunk/phase3/includes/media/SVGMetadataExtractor.php
===================================================================
--- trunk/phase3/includes/media/SVGMetadataExtractor.php 2011-05-25
23:56:45 UTC (rev 88869)
+++ trunk/phase3/includes/media/SVGMetadataExtractor.php 2011-05-25
23:57:44 UTC (rev 88870)
@@ -101,7 +101,7 @@
$keepReading = $this->reader->read();
}
- if ( !$this->qualifiedNameEquals( $this->reader->name, 'svg',
'svg' ) ) {
+ if ( $this->reader->name != 'svg' ) {
throw new MWException( "Expected <svg> tag, got ".
$this->reader->name );
}
@@ -116,13 +116,13 @@
$this->debug( "$tag" );
- if ( $this->qualifiedNameEquals( $tag, 'svg', 'svg' )
&& $type == XmlReader::END_ELEMENT && $this->reader->depth <= $exitDepth ) {
+ if ( $tag == 'svg' && $type == XmlReader::END_ELEMENT
&& $this->reader->depth <= $exitDepth ) {
break;
- } elseif ( $this->qualifiedNameEquals( $tag, 'svg',
'title' ) ) {
+ } elseif ( $tag == 'title' ) {
$this->readField( $tag, 'title' );
- } elseif ( $this->qualifiedNameEquals( $tag, 'svg',
'desc' ) ) {
+ } elseif ( $tag == 'desc' ) {
$this->readField( $tag, 'description' );
- } elseif ( $this->qualifiedNameEquals( $tag, 'svg',
'metadata' ) && $type == XmlReader::ELEMENT ) {
+ } elseif ( $tag == 'metadata' && $type ==
XmlReader::ELEMENT ) {
$this->readXml( $tag, 'metadata' );
} elseif ( $tag !== '#text' ) {
$this->debug( "Unhandled top-level XML tag
$tag" );
@@ -201,15 +201,10 @@
} elseif ( $this->reader->nodeType ==
XmlReader::ELEMENT ) {
switch( $this->reader->name ) {
case 'animate':
- case 'svg:animate':
case 'set':
- case 'svg:set':
case 'animateMotion':
- case 'svg:animateMotion':
case 'animateColor':
- case 'svg:animateColor':
case 'animateTransform':
- case 'svg:animateTransform':
$this->debug( "HOUSTON WE HAVE
ANIMATION" );
$this->metadata['animated'] =
true;
break;
@@ -318,22 +313,4 @@
return floatval( $length );
}
}
-
- /**
- * XML namespace check
- *
- * Check if a read node name matches the expected nodeName
- * @param $qualifiedName as read by XMLReader
- * @param $prefix the namespace prefix that you expect for this
element, defaults to svg namespace
- * @param $localName the localName part of the element that you want to
match
- *
- * @return boolean
- */
- private function qualifiedNameEquals( $qualifiedName, $prefix="svg",
$localName ) {
- if( ($qualifiedName == $localName && $prefix == "svg" ) ||
- $qualifiedName == ($prefix . ":" . $localName) ) {
- return true;
- }
- return false;
- }
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs