From 13c8aee478cabdf2c0d6b8d9e3f5abd739400e0d Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Fri, 4 Nov 2011 08:58:10 +0000 Subject: [PATCH] Use WikiPage instead of Article to call the hasViewableContent() method --- includes/search/SearchEngine.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/includes/search/SearchEngine.php b/includes/search/SearchEngine.php index 260c2486e1..04d289d6d3 100644 --- a/includes/search/SearchEngine.php +++ b/includes/search/SearchEngine.php @@ -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; } -- 2.20.1