section anchor encoding:
authorGabriel Wicke <gwicke@users.mediawiki.org>
Wed, 2 Jun 2004 15:19:28 +0000 (15:19 +0000)
committerGabriel Wicke <gwicke@users.mediawiki.org>
Wed, 2 Jun 2004 15:19:28 +0000 (15:19 +0000)
'%' -> '.'
pseudo-urlencoded for enough uniqueness in non-ascii languages

includes/EditPage.php
includes/Parser.php

index 68e1b9d..a4fbb5b 100644 (file)
@@ -212,6 +212,7 @@ class EditPage {
                                                $headline = preg_replace( "/<.*?" . ">/","",$headline );
                                                $headline = trim( $headline );
                                                $sectionanchor = '#'.preg_replace("/[ \\?&\\/<>\\(\\)\\[\\]=,+']+/", '_', urlencode( $headline ) );
+                                               $sectionanchor = str_replace('%','.',$sectionanchor);
                                        }
                                }
        
index 8619918..5aabf40 100644 (file)
@@ -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 &nbsp; (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