r24207 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24206‎ | r24207 | r24208 >
Date:17:16, 17 July 2007
Author:brion
Status:old
Tags:
Comment:
* (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.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Wiki.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Wiki.php
@@ -118,16 +118,14 @@
119119 */
120120 function preliminaryChecks ( &$title, &$output, $request ) {
121121
122 - # Debug statement for user levels
123 - // print_r($wgUser);
124 -
125 - $search = $request->getText( 'search' );
126 - if( !is_null( $search ) && $search !== '' ) {
 122+ if( $request->getCheck( 'search' ) ) {
127123 // Compatibility with old search URLs which didn't use Special:Search
 124+ // Just check for presence here, so blank requests still
 125+ // show the search page when using ugly URLs (bug 8054).
 126+
128127 // Do this above the read whitelist check for security...
129128 $title = SpecialPage::getTitleFor( 'Search' );
130129 }
131 - $this->setVal( 'Search', $search );
132130
133131 # If the user is not logged in, the Namespace:title of the article must be in
134132 # the Read array in order for the user to see it. (We have to check here to
@@ -147,13 +145,8 @@
148146 global $wgRequest;
149147 wfProfileIn( 'MediaWiki::initializeSpecialCases' );
150148
151 - $search = $this->getVal('Search');
152149 $action = $this->getVal('Action');
153 - if( !$this->getVal('DisableInternalSearch') && !is_null( $search ) && $search !== '' ) {
154 - require_once( 'includes/SpecialSearch.php' );
155 - $title = SpecialPage::getTitleFor( 'Search' );
156 - wfSpecialSearch();
157 - } else if( !$title or $title->getDBkey() == '' ) {
 150+ if( !$title or $title->getDBkey() == '' ) {
158151 $title = SpecialPage::getTitleFor( 'Badtitle' );
159152 # Die now before we mess up $wgArticle and the skin stops working
160153 throw new ErrorPageError( 'badtitle', 'badtitletext' );
Index: trunk/phase3/RELEASE-NOTES
@@ -309,6 +309,7 @@
310310 * (bug 4650) Keep impossibly large/small counts off Special:Statistics
311311 * (bug 10608) PHP notice when installing with PostgreSQL
312312 * (bug 10615) Fix for transwiki import when CURL not available
 313+* (bug 8054) Return search page for empty search requests with ugly URLs
313314
314315
315316 == API changes since 1.10 ==

Follow-up revisions

RevisionCommit summaryAuthorDate
r24215Merged revisions 24095-24212 via svnmerge from...david21:19, 17 July 2007

Status & tagging log