r40685 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40684‎ | r40685 | r40686 >
Date:22:31, 9 September 2008
Author:mrzman
Status:old
Tags:
Comment:
Sanitizer::escapeHtmlAllowEntities() only exists in 1.14, so this is unnecessary.
Modified paths:
  • /trunk/extensions/ImageMap/ImageMap_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ImageMap/ImageMap_body.php
@@ -70,32 +70,8 @@
7171 if ( wfIsBadImage( $imageTitle->getDBkey() , $parser->mTitle ) ) {
7272 return self::error( 'imagemap_bad_image' );
7373 }
74 - // Parse the options so we can use links and the like in the caption, code adapted from Cite extension
75 - if ( method_exists( $parser, 'recursiveTagParse' ) ) {
76 - // New fast method
77 - $parsedoptions = $parser->recursiveTagParse( Sanitizer::escapeHtmlAllowEntities($options) );
78 - } else {
79 - // Old method
80 - $ret = $parser->parse(
81 - Sanitizer::escapeHtmlAllowEntities($options),
82 - $parser->mTitle,
83 - $parser->mOptions,
84 - // Avoid whitespace buildup
85 - false,
86 - false
87 - );
88 - $text = $ret->getText();
89 - global $wgUseTidy;
90 - if ( ! $wgUseTidy )
91 - $parsedoptions = $text;
92 - else {
93 - $text = preg_replace( '~^<p>\s*~', '', $text );
94 - $text = preg_replace( '~\s*</p>\s*~', '', $text );
95 - $text = preg_replace( '~\n$~', '', $text );
96 -
97 - $parsedoptions = $text;
98 - }
99 - }
 74+ // Parse the options so we can use links and the like in the caption
 75+ $parsedoptions = $parser->recursiveTagParse( Sanitizer::escapeHtmlAllowEntities($options) );
10076 $imageHTML = $parser->makeImage( $imageTitle, $parsedoptions );
10177 $parser->mOutput->addImage( $imageTitle->getDBkey() );
10278