From d7de2073e57da941d28905e7b8d757608815bdd3 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Thu, 5 Jan 2006 05:27:16 +0000 Subject: [PATCH] Allow + in titles --- includes/Title.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/includes/Title.php b/includes/Title.php index 47b877c04b..8053757b84 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -161,14 +161,17 @@ class Title { * @access public */ function newFromURL( $url ) { + global $wgLegalTitleChars; $t = new Title(); - # For compatibility with old buggy URLs. "+" is not valid in titles, + # For compatibility with old buggy URLs. "+" is usually 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 ); + if ( strpos( $wgLegalTitleChars, '+' ) === false ) { + $url = str_replace( '+', ' ', $url ); + } - $t->mDbkeyform = str_replace( ' ', '_', $s ); + $t->mDbkeyform = str_replace( ' ', '_', $url ); if( $t->secureAndSplit() ) { return $t; } else { -- 2.20.1