Allow compatibility with incoming URLs with '+' used instead of space. These are created by some external search tools, and some very old links on the wiki. Our old rewrite rules on Wikipedia let this through, but the new ones don't without explicit support.

This commit is contained in:
Brion Vibber 2004-05-30 06:43:26 +00:00
parent e03353126d
commit 09a414a149

View 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.