From: Alexandre Emsenhuber Date: Fri, 4 Nov 2011 08:58:10 +0000 (+0000) Subject: Use WikiPage instead of Article to call the hasViewableContent() method X-Git-Tag: 1.31.0-rc.0~26708 X-Git-Url: http://git.cyclocoop.org///%22%40url%40//%22?a=commitdiff_plain;h=13c8aee478cabdf2c0d6b8d9e3f5abd739400e0d;p=lhc%2Fweb%2Fwiklou.git Use WikiPage instead of Article to call the hasViewableContent() method --- 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; }