From 09a414a149f7b8991c6dce2fba2ea6dcd55bd96f Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 30 May 2004 06:43:26 +0000 Subject: [PATCH] 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. --- includes/Title.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/Title.php b/includes/Title.php index ea9c4e22e2..32a4e9c7f2 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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. -- 2.20.1