From: Gabriel Wicke Date: Tue, 25 May 2004 14:26:14 +0000 (+0000) Subject: accept urlencoded (interwiki) links X-Git-Tag: 1.5.0alpha1~3205 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=bce772029ecc898a50dfd6064beeaa88e647370e;p=lhc%2Fweb%2Fwiklou.git accept urlencoded (interwiki) links --- diff --git a/includes/Parser.php b/includes/Parser.php index bfaf90093c..4404e7d6d3 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -958,7 +958,8 @@ class Parser wfProfileIn( "$fname-setup" ); static $tc = FALSE; - if ( !$tc ) { $tc = Title::legalChars() . "#"; } + # the % is needed to support urlencoded titles as well + if ( !$tc ) { $tc = Title::legalChars() . "#%"; } $sk =& $this->mOptions->getSkin(); # Match a link having the form [[namespace:link|alternate]]trail @@ -988,6 +989,8 @@ class Parser if ( preg_match( $e1, $line, $m ) ) { # page with normal text or alt $text = $m[2]; + # fix up urlencoded title texts + if(preg_match("/%/", $m[1] )) $m[1] = urldecode($m[1]); $trail = $m[3]; } else { # Invalid form; output directly $s .= $prefix . "[[" . $line ;