* (bug 15264) Underscores in Special:Search/Foo_bar parameters were taken
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 26 Aug 2008 20:17:58 +0000 (20:17 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 26 Aug 2008 20:17:58 +0000 (20:17 +0000)
  literally; now converting them to spaces per expectation.

RELEASE-NOTES
includes/specials/SpecialSearch.php

index 20253a6..ad1a4da 100644 (file)
@@ -1,4 +1,4 @@
-= MediaWiki release notes =
+T= MediaWiki release notes =
 
 Security reminder: MediaWiki does not require PHP's register_globals
 setting since version 1.2.0. If you have it on, turn it *off* if you can.
@@ -146,6 +146,9 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Action=purge on ForeignApiFiles now works (purges their thumbnails and 
   description pages).
 * (bug 15303) Title conversion for templates wasn't working in some cases.
+* (bug 15264) Underscores in Special:Search/Foo_bar parameters were taken
+  literally; now converting them to spaces per expectation.
+
 
 === API changes in 1.14 ===
 
index 904c2d8..815946b 100644 (file)
 function wfSpecialSearch( $par = '' ) {
        global $wgRequest, $wgUser;
 
-       $search = str_replace( "\n", " ", $wgRequest->getText( 'search', $par ) );
+       // Strip underscores from title parameter; most of the time we'll want
+       // text form here. But don't strip underscores from actual text params!
+       $titleParam = str_replace( '_', ' ', $par );
+       
+       $search = str_replace( "\n", " ", $wgRequest->getText( 'search', $titleParam ) );
        $searchPage = new SpecialSearch( $wgRequest, $wgUser );
        if( $wgRequest->getVal( 'fulltext' ) 
                || !is_null( $wgRequest->getVal( 'offset' ))