Allow compatibility with incoming URLs with '+' used instead of space. These are...
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 30 May 2004 06:43:26 +0000 (06:43 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 30 May 2004 06:43:26 +0000 (06:43 +0000)
includes/Title.php

index ea9c4e2..32a4e9c 100644 (file)
@@ -90,11 +90,11 @@ class Title {
        {
                global $wgLang, $wgServer;
                $t = new Title();
-               $s = urldecode( $url ); # This is technically wrong, as anything
-                                                               # we've gotten is already decoded by PHP.
-                                                               # Kept for backwards compatibility with
-                                                               # buggy URLs we had for a while...
-               $s = $url;
+               
+               # For compatibility with old buggy URLs. "+" is not valid in titles,
+               # but some URLs used it as a space replacement and they still come
+               # from some external search tools.
+               $s = str_replace( "+", " ", $url );
                
                # For links that came from outside, check for alternate/legacy
                # character encoding.