Fix source forge bug 694639
authorAntoine Musso <hashar@users.mediawiki.org>
Tue, 16 Mar 2004 15:57:42 +0000 (15:57 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Tue, 16 Mar 2004 15:57:42 +0000 (15:57 +0000)
Thanks to gwicke on irc for teaching me how to stop + or * to be greedy (ie replace by +? and *?).

Space around column are striped from link but the link title still show the spaces.

includes/Title.php

index 0048fe4..c8373ce 100644 (file)
@@ -591,7 +591,7 @@ class Title {
                        $r = substr( $t, 1 );
                } else {
                        # Namespace or interwiki prefix
-                       if ( preg_match( "/^((?:i|x|[a-z]{2,3})(?:-[a-z0-9]+)?|[A-Za-z0-9_\\x80-\\xff]+):_*(.*)$/", $t, $m ) ) {
+                       if ( preg_match( "/^((?:i|x|[a-z]{2,3})(?:-[a-z0-9]+)?|[A-Za-z0-9_\\x80-\\xff]+?)_*:_*(.*)$/", $t, $m ) ) {
                                #$p = strtolower( $m[1] );
                                $p = $m[1];
                                if ( $ns = $wgLang->getNsIndex( strtolower( $p ) )) {