Index: trunk/phase3/includes/specials/SpecialSearch.php |
— | — | @@ -117,15 +117,19 @@ |
118 | 118 | $user = $this->getUser(); |
119 | 119 | # Extract manually requested namespaces |
120 | 120 | $nslist = $this->powerSearch( $request ); |
121 | | - $this->profile = $profile = $request->getVal( 'profile', null ); |
| 121 | + $profile = null; |
| 122 | + if ( !count( $nslist ) ) { |
| 123 | + $profile = 'default'; |
| 124 | + } |
| 125 | + $profile = $request->getVal( 'profile', $profile ); |
122 | 126 | $profiles = $this->getSearchProfiles(); |
123 | | - if ( $profile === null) { |
| 127 | + if ( $profile === null ) { |
124 | 128 | // BC with old request format |
125 | | - $this->profile = 'advanced'; |
| 129 | + $profile = 'advanced'; |
126 | 130 | if ( count( $nslist ) ) { |
127 | 131 | foreach( $profiles as $key => $data ) { |
128 | 132 | if ( $nslist === $data['namespaces'] && $key !== 'advanced') { |
129 | | - $this->profile = $key; |
| 133 | + $profile = $key; |
130 | 134 | } |
131 | 135 | } |
132 | 136 | $this->namespaces = $nslist; |
— | — | @@ -139,7 +143,7 @@ |
140 | 144 | $this->namespaces = $profiles[$profile]['namespaces']; |
141 | 145 | } else { |
142 | 146 | // Unknown profile requested |
143 | | - $this->profile = 'default'; |
| 147 | + $profile = 'default'; |
144 | 148 | $this->namespaces = $profiles['default']['namespaces']; |
145 | 149 | } |
146 | 150 | } |
— | — | @@ -149,6 +153,7 @@ |
150 | 154 | $this->searchRedirects = $request->getBool( 'redirs', $default ) ? 1 : 0; |
151 | 155 | $this->didYouMeanHtml = ''; # html of did you mean... link |
152 | 156 | $this->fulltext = $request->getVal('fulltext'); |
| 157 | + $this->profile = $profile; |
153 | 158 | } |
154 | 159 | |
155 | 160 | /** |