Use WikiPage instead of Article to call the hasViewableContent() method
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 4 Nov 2011 08:58:10 +0000 (08:58 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 4 Nov 2011 08:58:10 +0000 (08:58 +0000)
includes/search/SearchEngine.php

index 260c248..04d289d 100644 (file)
@@ -161,8 +161,6 @@ class SearchEngine {
                        return $titleResult;
                }
 
-               $context = new RequestContext;
-
                foreach ( $allSearchTerms as $term ) {
 
                        # Exact match? No need to look further.
@@ -176,9 +174,8 @@ class SearchEngine {
                        }
 
                        # See if it still otherwise has content is some sane sense
-                       $context->setTitle( $title );
-                       $article = Article::newFromTitle( $title, $context );
-                       if ( $article->hasViewableContent() ) {
+                       $page = WikiPage::factory( $title );
+                       if ( $page->hasViewableContent() ) {
                                return $title;
                        }