Don't escape >" in tag contents, no point
authorAryeh Gregor <simetrical@users.mediawiki.org>
Fri, 21 Aug 2009 20:38:53 +0000 (20:38 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Fri, 21 Aug 2009 20:38:53 +0000 (20:38 +0000)
includes/Html.php

index ae10ac6..07d234a 100644 (file)
@@ -126,7 +126,12 @@ class Html {
         * Identical to rawElement(), but HTML-escapes $contents.
         */
        public static function element( $element, $attribs = array(), $contents = '' ) {
-               return self::rawElement( $element, $attribs, htmlspecialchars( $contents ) );
+               return self::rawElement( $element, $attribs, strtr( $contents, array(
+                       # There's no point in escaping quotes, >, etc. in the contents of
+                       # elements.
+                       '&' => '&amp;',
+                       '<' => '&lt;'
+               ) ) );
        }
 
        /**