From: Aryeh Gregor Date: Mon, 8 Feb 2010 20:15:32 +0000 (+0000) Subject: Strip # from IDs, IE doesn't seem to like them X-Git-Tag: 1.31.0-rc.0~37872 X-Git-Url: https://git.cyclocoop.org/%7B%7B%20url_for%28?a=commitdiff_plain;h=58227f314e7ed6dabd0b1b3d8383c2745cd2bff5;p=lhc%2Fweb%2Fwiklou.git Strip # from IDs, IE doesn't seem to like them --- diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php index 810284324b..8533990a92 100644 --- a/includes/Sanitizer.php +++ b/includes/Sanitizer.php @@ -857,6 +857,7 @@ class Sanitizer { * * To ensure we don't have to bother escaping anything, we also strip ', ", * & even if $wgExperimentalIds is true. TODO: Is this the best tactic? + * We also strip # because it upsets IE6. * * @see http://www.w3.org/TR/html401/types.html#type-name Valid characters * in the id and @@ -882,7 +883,7 @@ class Sanitizer { if ( $wgHtml5 && $wgExperimentalHtmlIds && !in_array( 'legacy', $options ) ) { $id = Sanitizer::decodeCharReferences( $id ); - $id = preg_replace( '/[ \t\n\r\f_\'"&]+/', '_', $id ); + $id = preg_replace( '/[ \t\n\r\f_\'"&#]+/', '_', $id ); $id = trim( $id, '_' ); if ( $id === '' ) { # Must have been all whitespace to start with.