Don't freak out about #redirect: [[blah]], this was relatively common usage in older...
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 9 Aug 2008 00:33:02 +0000 (00:33 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 9 Aug 2008 00:33:02 +0000 (00:33 +0000)
includes/Title.php

index e3124d5..ed28f8b 100644 (file)
@@ -300,8 +300,9 @@ class Title {
                if( $redir->matchStartAndRemove( $text ) ) {
                        // Extract the first link and see if it's usable
                        // Ensure that it really does come directly after #REDIRECT
+                       // Some older redirects included a colon, so don't freak about that!
                        $m = array();
-                       if( preg_match( '!^\s*\[{2}(.*?)(?:\|.*?)?\]{2}!', $text, $m ) ) {
+                       if( preg_match( '!^\s*:?\s*\[{2}(.*?)(?:\|.*?)?\]{2}!', $text, $m ) ) {
                                // Strip preceding colon used to "escape" categories, etc.
                                // and URL-decode links
                                if( strpos( $m[1], '%' ) !== false ) {