From: Tim Starling Date: Thu, 5 Jan 2006 05:27:16 +0000 (+0000) Subject: Allow + in titles X-Git-Tag: 1.6.0~758 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_add%27%29%20%7D%7D?a=commitdiff_plain;h=d7de2073e57da941d28905e7b8d757608815bdd3;p=lhc%2Fweb%2Fwiklou.git Allow + in titles --- 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 {