From c9bbe3cb032e90d1516dfeb67cd40c31175543ad Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Fri, 14 Mar 2008 21:57:09 +0000 Subject: [PATCH] (bug 2084) Fixed incorrect regex to match redirects --- RELEASE-NOTES | 1 + includes/Title.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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 ) { -- 2.20.1