From a0fbb5e730740a8ee26724303e00ae514951b351 Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Wed, 2 Jun 2004 15:19:28 +0000 Subject: [PATCH] section anchor encoding: '%' -> '.' pseudo-urlencoded for enough uniqueness in non-ascii languages --- includes/EditPage.php | 1 + includes/Parser.php | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index 68e1b9dff2..a4fbb5b5c5 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -212,6 +212,7 @@ class EditPage { $headline = preg_replace( "/<.*?" . ">/","",$headline ); $headline = trim( $headline ); $sectionanchor = '#'.preg_replace("/[ \\?&\\/<>\\(\\)\\[\\]=,+']+/", '_', urlencode( $headline ) ); + $sectionanchor = str_replace('%','.',$sectionanchor); } } diff --git a/includes/Parser.php b/includes/Parser.php index 86199186fc..5aabf400d8 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -1731,8 +1731,7 @@ class Parser $canonized_headline = preg_replace( "/<.*?" . ">/","",$canonized_headline ); $tocline = trim( $canonized_headline ); $canonized_headline = preg_replace("/[ \\?&\\/<>\\(\\)\\[\\]=,+']+/", '_', urlencode( do_html_entity_decode( $tocline, ENT_COMPAT, $wgInputEncoding ) ) ); - # strip out urlencoded   (inserted for french spaces, e.g. first space in 'something : something') - $canonized_headline = str_replace('%C2%A0','_', $canonized_headline); + $canonized_headline = str_replace('%','.',$canonized_headline); $refer[$headlineCount] = $canonized_headline; # count how many in assoc. array so we can track dupes in anchors -- 2.20.1