diff --git a/includes/Hooks/SearchResultProvideThumbnailHookHandler.php b/includes/Hooks/SearchResultProvideThumbnailHookHandler.php index d903e44..5c39078 100644 --- a/includes/Hooks/SearchResultProvideThumbnailHookHandler.php +++ b/includes/Hooks/SearchResultProvideThumbnailHookHandler.php @@ -53,7 +53,7 @@ class SearchResultProvideThumbnailHookHandler implements SearchResultProvideThum $propValues = $this->pageProps->getProperties( $nonFileIdentitiesByPageId, // T320661: only provide free images for search purposes - PageImages::getPropNames( PageImages::LICENSE_FREE ) + (array)PageImages::getPropNames( PageImages::LICENSE_FREE ) ); $fileNames = array_map( static function ( $prop ) { return $prop[ PageImages::getPropName( false ) ] diff --git a/tests/phpunit/Hooks/SearchResultProvideThumbnailHookHandlerTest.php b/tests/phpunit/Hooks/SearchResultProvideThumbnailHookHandlerTest.php index 751bc67..b5b4582 100644 --- a/tests/phpunit/Hooks/SearchResultProvideThumbnailHookHandlerTest.php +++ b/tests/phpunit/Hooks/SearchResultProvideThumbnailHookHandlerTest.php @@ -116,7 +116,7 @@ class SearchResultProvideThumbnailHookHandlerTest extends MediaWikiIntegrationTe ->method( 'getProperties' ) ->with( $this->anything(), - PageImages::getPropNames( PageImages::LICENSE_FREE ) + (array)PageImages::getPropNames( PageImages::LICENSE_FREE ) )->willReturn( [ 1 => [ PageImages::getPropName( true ) => 'File1_free.jpg'