enable redirects for urlencoded anchor names
authorGabriel Wicke <gwicke@users.mediawiki.org>
Tue, 1 Jun 2004 19:51:22 +0000 (19:51 +0000)
committerGabriel Wicke <gwicke@users.mediawiki.org>
Tue, 1 Jun 2004 19:51:22 +0000 (19:51 +0000)
includes/EditPage.php

index a082c65..68e1b9d 100644 (file)
@@ -204,11 +204,12 @@ class EditPage {
                                        $hasmatch = preg_match( "/^ *([=]{1,6})(.*?)(\\1) *\\n/i", $this->textbox1, $matches );
                                        # we can't deal with anchors, includes, html etc in the header for now, 
                                        # headline would need to be parsed to improve this
-                                       if($hasmatch and strlen($matches[2]) > 0 and !preg_match( "/[\\['{<>]/", $matches[2])) {
+                                       #if($hasmatch and strlen($matches[2]) > 0 and !preg_match( "/[\\['{<>]/", $matches[2])) {
+                                       if($hasmatch and strlen($matches[2]) > 0) {
                                                global $wgInputEncoding;
                                                $headline = do_html_entity_decode( $matches[2], ENT_COMPAT, $wgInputEncoding );
-                                               # strip out HTML, will be useful when 
-                                               $headline = preg_replace( "/<.*?" . ">/","",$headline );
+                                               # strip out HTML 
+                                               $headline = preg_replace( "/<.*?" . ">/","",$headline );
                                                $headline = trim( $headline );
                                                $sectionanchor = '#'.preg_replace("/[ \\?&\\/<>\\(\\)\\[\\]=,+']+/", '_', urlencode( $headline ) );
                                        }