From 137ce4517bb02c5eb9940d1c7318c70de0e9733f Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 17 Jul 2007 17:16:59 +0000 Subject: [PATCH] * (bug 8054) Return search page for empty search requests with ugly URLs Send things to Special:Search as long as a 'search=' parameter is given, even if it's empty. Also removed a redundant second check for the parameter. --- RELEASE-NOTES | 1 + includes/Wiki.php | 17 +++++------------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 9c189a7ee9..2056047e80 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -309,6 +309,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 4650) Keep impossibly large/small counts off Special:Statistics * (bug 10608) PHP notice when installing with PostgreSQL * (bug 10615) Fix for transwiki import when CURL not available +* (bug 8054) Return search page for empty search requests with ugly URLs == API changes since 1.10 == diff --git a/includes/Wiki.php b/includes/Wiki.php index 23317bf92d..72a6a61db8 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -118,16 +118,14 @@ class MediaWiki { */ function preliminaryChecks ( &$title, &$output, $request ) { - # Debug statement for user levels - // print_r($wgUser); - - $search = $request->getText( 'search' ); - if( !is_null( $search ) && $search !== '' ) { + if( $request->getCheck( 'search' ) ) { // Compatibility with old search URLs which didn't use Special:Search + // Just check for presence here, so blank requests still + // show the search page when using ugly URLs (bug 8054). + // Do this above the read whitelist check for security... $title = SpecialPage::getTitleFor( 'Search' ); } - $this->setVal( 'Search', $search ); # If the user is not logged in, the Namespace:title of the article must be in # the Read array in order for the user to see it. (We have to check here to @@ -147,13 +145,8 @@ class MediaWiki { global $wgRequest; wfProfileIn( 'MediaWiki::initializeSpecialCases' ); - $search = $this->getVal('Search'); $action = $this->getVal('Action'); - if( !$this->getVal('DisableInternalSearch') && !is_null( $search ) && $search !== '' ) { - require_once( 'includes/SpecialSearch.php' ); - $title = SpecialPage::getTitleFor( 'Search' ); - wfSpecialSearch(); - } else if( !$title or $title->getDBkey() == '' ) { + if( !$title or $title->getDBkey() == '' ) { $title = SpecialPage::getTitleFor( 'Badtitle' ); # Die now before we mess up $wgArticle and the skin stops working throw new ErrorPageError( 'badtitle', 'badtitletext' ); -- 2.20.1