From 3a6dd941c79401e567e438d823be9fb91c49ad6b Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Fri, 2 Jan 2009 20:59:07 +0000 Subject: [PATCH] Do not urlencode anchor in links we output This fixes non-TOC links in IE5, 5.5, and 6 (didn't test 7) when $wgEnforceHtmlIds is off. These browsers won't follow urlencoded Unicode anchors in href's, they only work if not urlencoded. Having non-urlencoded bits in href's should be perfectly fine, correct me if I'm wrong. As far as I can tell, Title::escapeFragmentForURL() is never used for HTTP redirects, if there's any concern about those. The correct function to fix those is Article::doRedirect(). My testing indicates that IE{5,5.5,6} will not accept Unicode anchors in anchors in HTTP redirects, whether urlencoded or not. --- includes/Title.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/Title.php b/includes/Title.php index 17107c7986..f91ac09a6b 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -452,8 +452,8 @@ class Title { */ static function escapeFragmentForURL( $fragment ) { global $wgEnforceHtmlIds; - return wfUrlencode( Sanitizer::escapeId( $fragment, - $wgEnforceHtmlIds ? array() : 'xml' ) ); + return Sanitizer::escapeId( $fragment, + $wgEnforceHtmlIds ? array() : 'xml' ); } #---------------------------------------------------------------------------- -- 2.20.1