From: Alexandre Emsenhuber Date: Fri, 14 Mar 2008 21:57:09 +0000 (+0000) Subject: (bug 2084) Fixed incorrect regex to match redirects X-Git-Tag: 1.31.0-rc.0~49096 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=c9bbe3cb032e90d1516dfeb67cd40c31175543ad;p=lhc%2Fweb%2Fwiklou.git (bug 2084) Fixed incorrect regex to match redirects --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 287c9c0f2e..4a95ba5ce4 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -87,6 +87,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 13298) Tighter limits on Special:Newpages limits when embedding * Email subject in content language instead of sending user's UI language * (bug 13251) Allow maintenance rebuild scripts to work with Postgres +* (bug 2084) Fixed incorrect regex to match redirects === API changes in 1.13 === diff --git a/includes/Title.php b/includes/Title.php index c07518ad45..c65ce10000 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -288,7 +288,7 @@ class Title { if( $redir->matchStart( trim($text) ) ) { // Extract the first link and see if it's usable $m = array(); - if( preg_match( '!\[{2}(.*?)(?:\||\]{2})!', $text, $m ) ) { + if( preg_match( '!\[{2}(.*?)(?:\|.*?)?\]{2}!', $text, $m ) ) { // Strip preceding colon used to "escape" categories, etc. // and URL-decode links if( strpos( $m[1], '%' ) !== false ) {