From bce772029ecc898a50dfd6064beeaa88e647370e Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Tue, 25 May 2004 14:26:14 +0000 Subject: [PATCH] accept urlencoded (interwiki) links --- includes/Parser.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 ; -- 2.20.1