From e6df1dee1d19a8efd6ca4611c5a1f4972b9d8058 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Thu, 29 Mar 2007 18:57:54 +0000 Subject: [PATCH] (bug 8914) Don't transform colons in {{anchorencode:}} --- RELEASE-NOTES | 6 +++--- includes/CoreParserFunctions.php | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 7e692c706d..37bcb583c7 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -289,9 +289,9 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 4756) Add user tool links for self created accounts at special:log instead of sometimes broken block links from newuserlog extension * (bug 5817) Special:Recentchangeslinked now shows red link for nonexistent - target page instead of silently redirecting. - - + target page instead of silently redirecting +* (bug 8914) Don't transform colons in {{anchorencode:}} + == Maintenance == * New script maintenance/language/checkExtensioni18n.php used to check i18n progress in the extension repository. diff --git a/includes/CoreParserFunctions.php b/includes/CoreParserFunctions.php index 1b08e82bcb..0c4d0a0c81 100644 --- a/includes/CoreParserFunctions.php +++ b/includes/CoreParserFunctions.php @@ -169,7 +169,11 @@ class CoreParserFunctions { } static function anchorencode( $parser, $text ) { - return strtr( urlencode( $text ) , array( '%' => '.' , '+' => '_' ) ); + $a = urlencode( $text ); + $a = strtr( $a, array( '%' => '.', '+' => '_' ) ); + # leave colons alone, however + $a = str_replace( '.3A', ':', $a ); + return $a; } static function special( $parser, $text ) { -- 2.20.1