From: Gabriel Wicke Date: Tue, 1 Jun 2004 19:51:22 +0000 (+0000) Subject: enable redirects for urlencoded anchor names X-Git-Tag: 1.5.0alpha1~3091 X-Git-Url: https://git.cyclocoop.org/%7B%7B%20url_for%28?a=commitdiff_plain;h=1c974f646f8628595c85f1074438f38f4aa4fd97;p=lhc%2Fweb%2Fwiklou.git enable redirects for urlencoded anchor names --- diff --git a/includes/EditPage.php b/includes/EditPage.php index a082c6592d..68e1b9dff2 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -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 ) ); }