Follow-up r85929: update MediaWiki::articleFromTitle() call in SearchEngine.php
authorHappy-melon <happy-melon@users.mediawiki.org>
Wed, 13 Apr 2011 14:27:59 +0000 (14:27 +0000)
committerHappy-melon <happy-melon@users.mediawiki.org>
Wed, 13 Apr 2011 14:27:59 +0000 (14:27 +0000)
includes/search/SearchEngine.php

index b8b14de..ba203ca 100644 (file)
@@ -129,19 +129,23 @@ class SearchEngine {
                        return $titleResult;
                }
 
+               $context = new RequestContext;
+
                foreach ( $allSearchTerms as $term ) {
 
                        # Exact match? No need to look further.
                        $title = Title::newFromText( $term );
-                       if ( is_null( $title ) )
+                       if ( is_null( $title ) ){
                                return null;
+                       }
 
                        if ( $title->getNamespace() == NS_SPECIAL || $title->isExternal() || $title->exists() ) {
                                return $title;
                        }
 
                        # See if it still otherwise has content is some sane sense
-                       $article = MediaWiki::articleFromTitle( $title );
+                       $context->setTitle( $title );
+                       $article = MediaWiki::articleFromTitle( $title, $context );
                        if ( $article->hasViewableContent() ) {
                                return $title;
                        }