r44252 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44251‎ | r44252 | r44253 >
Date:17:10, 5 December 2008
Author:aaron
Status:ok
Tags:
Comment:
Keep form only for "file:" searches
Modified paths:
  • /trunk/phase3/includes/specials/SpecialSearch.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialSearch.php
@@ -111,7 +111,7 @@
112112 * @param string $term
113113 */
114114 public function showResults( $term ) {
115 - global $wgOut, $wgDisableTextSearch;
 115+ global $wgOut, $wgDisableTextSearch, $wgContLang;
116116 wfProfileIn( __METHOD__ );
117117
118118 $this->setupPage( $term );
@@ -129,7 +129,8 @@
130130 Xml::closeElement('table')
131131 );
132132
133 - if( '' === trim( $term ) ) {
 133+ $filePrefix = $wgContLang->getFormattedNsText(NS_FILE).':';
 134+ if( '' === trim( $term ) || $filePrefix === trim( $term ) ) {
134135 // Empty query -- straight view of search form
135136 wfProfileOut( __METHOD__ );
136137 return;

Status & tagging log