From: Brion Vibber Date: Tue, 26 Aug 2008 20:17:58 +0000 (+0000) Subject: * (bug 15264) Underscores in Special:Search/Foo_bar parameters were taken X-Git-Tag: 1.31.0-rc.0~45645 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=a6bacce782ac2a0223b0adf1e95c5c298b66f452;p=lhc%2Fweb%2Fwiklou.git * (bug 15264) Underscores in Special:Search/Foo_bar parameters were taken literally; now converting them to spaces per expectation. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 20253a67b2..ad1a4da4d5 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index 904c2d845e..815946bf8f 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -31,7 +31,11 @@ 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' ))