r55431 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55430‎ | r55431 | r55432 >
Date:20:38, 21 August 2009
Author:simetrical
Status:ok
Tags:
Comment:
Don't escape >" in tag contents, no point
Modified paths:
  • /trunk/phase3/includes/Html.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Html.php
@@ -126,7 +126,12 @@
127127 * Identical to rawElement(), but HTML-escapes $contents.
128128 */
129129 public static function element( $element, $attribs = array(), $contents = '' ) {
130 - return self::rawElement( $element, $attribs, htmlspecialchars( $contents ) );
 130+ return self::rawElement( $element, $attribs, strtr( $contents, array(
 131+ # There's no point in escaping quotes, >, etc. in the contents of
 132+ # elements.
 133+ '&' => '&',
 134+ '<' => '&lt;'
 135+ ) ) );
131136 }
132137
133138 /**

Status & tagging log