r40896 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40895‎ | r40896 | r40897 >
Date:02:17, 16 September 2008
Author:tstarling
Status:old
Tags:
Comment:
Run the post-internalParse() parser stages on the output of makeImage() before attempting to parse it as XHTML, in particular: unstrip, RLH and normalizeCharReferences(). Fixes invalid character references as per complaint on wikitech-l.
Modified paths:
  • /trunk/extensions/ImageMap/ImageMap_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ImageMap/ImageMap_body.php
@@ -71,8 +71,11 @@
7272 return self::error( 'imagemap_bad_image' );
7373 }
7474 // Parse the options so we can use links and the like in the caption
75 - $parsedoptions = $parser->recursiveTagParse( $options );
76 - $imageHTML = $parser->makeImage( $imageTitle, $parsedoptions );
 75+ $parsedOptions = $parser->recursiveTagParse( $options );
 76+ $imageHTML = $parser->makeImage( $imageTitle, $parsedOptions );
 77+ $parser->replaceLinkHolders( $imageHTML );
 78+ $imageHTML = $parser->mStripState->unstripBoth( $imageHTML );
 79+ $imageHTML = Sanitizer::normalizeCharReferences( $imageHTML );
7780 $parser->mOutput->addImage( $imageTitle->getDBkey() );
7881
7982 $domDoc = new DOMDocument();