Index: trunk/phase3/includes/search/SearchEngine.php |
— | — | @@ -129,19 +129,23 @@ |
130 | 130 | return $titleResult; |
131 | 131 | } |
132 | 132 | |
| 133 | + $context = new RequestContext; |
| 134 | + |
133 | 135 | foreach ( $allSearchTerms as $term ) { |
134 | 136 | |
135 | 137 | # Exact match? No need to look further. |
136 | 138 | $title = Title::newFromText( $term ); |
137 | | - if ( is_null( $title ) ) |
| 139 | + if ( is_null( $title ) ){ |
138 | 140 | return null; |
| 141 | + } |
139 | 142 | |
140 | 143 | if ( $title->getNamespace() == NS_SPECIAL || $title->isExternal() || $title->exists() ) { |
141 | 144 | return $title; |
142 | 145 | } |
143 | 146 | |
144 | 147 | # See if it still otherwise has content is some sane sense |
145 | | - $article = MediaWiki::articleFromTitle( $title ); |
| 148 | + $context->setTitle( $title ); |
| 149 | + $article = MediaWiki::articleFromTitle( $title, $context ); |
146 | 150 | if ( $article->hasViewableContent() ) { |
147 | 151 | return $title; |
148 | 152 | } |