Allow leading whitespace in redirect matches (bug 13344)
authorAaron Schulz <aaron@users.mediawiki.org>
Thu, 13 Mar 2008 14:08:47 +0000 (14:08 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Thu, 13 Mar 2008 14:08:47 +0000 (14:08 +0000)
includes/Title.php

index d6d763b..c07518a 100644 (file)
@@ -285,7 +285,7 @@ class Title {
         */
        public static function newFromRedirect( $text ) {
                $redir = MagicWord::get( 'redirect' );
-               if( $redir->matchStart( $text ) ) {
+               if( $redir->matchStart( trim($text) ) ) {
                        // Extract the first link and see if it's usable
                        $m = array();
                        if( preg_match( '!\[{2}(.*?)(?:\||\]{2})!', $text, $m ) ) {