r62134 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62133‎ | r62134 | r62135 >
Date:20:15, 8 February 2010
Author:simetrical
Status:ok
Tags:
Comment:
Strip # from IDs, IE doesn't seem to like them
Modified paths:
  • /trunk/phase3/includes/Sanitizer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Sanitizer.php
@@ -857,6 +857,7 @@
858858 *
859859 * To ensure we don't have to bother escaping anything, we also strip ', ",
860860 * & even if $wgExperimentalIds is true. TODO: Is this the best tactic?
 861+ * We also strip # because it upsets IE6.
861862 *
862863 * @see http://www.w3.org/TR/html401/types.html#type-name Valid characters
863864 * in the id and
@@ -882,7 +883,7 @@
883884
884885 if ( $wgHtml5 && $wgExperimentalHtmlIds && !in_array( 'legacy', $options ) ) {
885886 $id = Sanitizer::decodeCharReferences( $id );
886 - $id = preg_replace( '/[ \t\n\r\f_\'"&]+/', '_', $id );
 887+ $id = preg_replace( '/[ \t\n\r\f_\'"&#]+/', '_', $id );
887888 $id = trim( $id, '_' );
888889 if ( $id === '' ) {
889890 # Must have been all whitespace to start with.

Status & tagging log