(bug 2084) Fixed incorrect regex to match redirects
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 14 Mar 2008 21:57:09 +0000 (21:57 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 14 Mar 2008 21:57:09 +0000 (21:57 +0000)
RELEASE-NOTES
includes/Title.php

index 287c9c0..4a95ba5 100644 (file)
@@ -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 ===
 
index c07518a..c65ce10 100644 (file)
@@ -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 ) {