Do SearchUpdate::indexTitle after search-update is supported check
authoraude <aude.wiki@gmail.com>
Wed, 2 Dec 2015 15:34:25 +0000 (16:34 +0100)
committeraude <aude.wiki@gmail.com>
Wed, 2 Dec 2015 15:35:32 +0000 (16:35 +0100)
If the SearchEngine does not support search-update, then
$indexTitle is not used and thus no need to create it in
that case.

Change-Id: I487d06274e921223a3bcb5af846b48b7c2b8065e

includes/deferred/SearchUpdate.php

index 6ed1d00..867fc61 100644 (file)
@@ -82,11 +82,11 @@ class SearchUpdate implements DeferrableUpdate {
 
                foreach ( SearchEngine::getSearchTypes() as $type ) {
                        $search = SearchEngine::create( $type );
-                       $indexTitle = $this->indexTitle( $search );
                        if ( !$search->supports( 'search-update' ) ) {
                                continue;
                        }
 
+                       $indexTitle = $this->indexTitle( $search );
                        $normalTitle = $search->normalizeText( $indexTitle );
 
                        if ( $page === null ) {