r85950 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85949‎ | r85950 | r85951 >
Date:14:27, 13 April 2011
Author:happy-melon
Status:ok
Tags:
Comment:
Follow-up r85929: update MediaWiki::articleFromTitle() call in SearchEngine.php
Modified paths:
  • /trunk/phase3/includes/search/SearchEngine.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/search/SearchEngine.php
@@ -129,19 +129,23 @@
130130 return $titleResult;
131131 }
132132
 133+ $context = new RequestContext;
 134+
133135 foreach ( $allSearchTerms as $term ) {
134136
135137 # Exact match? No need to look further.
136138 $title = Title::newFromText( $term );
137 - if ( is_null( $title ) )
 139+ if ( is_null( $title ) ){
138140 return null;
 141+ }
139142
140143 if ( $title->getNamespace() == NS_SPECIAL || $title->isExternal() || $title->exists() ) {
141144 return $title;
142145 }
143146
144147 # 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 );
146150 if ( $article->hasViewableContent() ) {
147151 return $title;
148152 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r85929Implement a $context and getContext/setContext methods for Article (and its s...happy-melon23:00, 12 April 2011

Status & tagging log