Smalyshev has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/387103 )

Change subject: Make search more robust against bad configs
......................................................................

Make search more robust against bad configs

Some code pathes left variables uninitialized or relied on
configs which may not be set.

Change-Id: I11d5090d9783e449cfb49812ea25f94d9d1d8e26
---
M repo/includes/Search/Elastic/EntitySearchElastic.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/03/387103/1

diff --git a/repo/includes/Search/Elastic/EntitySearchElastic.php 
b/repo/includes/Search/Elastic/EntitySearchElastic.php
index 7452a2f..84474c2 100644
--- a/repo/includes/Search/Elastic/EntitySearchElastic.php
+++ b/repo/includes/Search/Elastic/EntitySearchElastic.php
@@ -56,7 +56,7 @@
         * List of fallback codes for search language
         * @var string[]
         */
-       private $searchLanguageCodes;
+       private $searchLanguageCodes = [];
 
        /**
         * Wikibase configuration settings for entity search
@@ -233,7 +233,7 @@
                if ( !$rescoreProfile ) {
                        $rescoreProfile = self::DEFAULT_RESCORE_PROFILE;
                }
-               if ( $this->settings['rescoreProfiles'][$rescoreProfile] ) {
+               if ( isset( $this->settings['rescoreProfiles'][$rescoreProfile] 
) ) {
                        return 
$this->settings['rescoreProfiles'][$rescoreProfile];
                }
                return $rescoreProfile;

-- 
To view, visit https://gerrit.wikimedia.org/r/387103
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I11d5090d9783e449cfb49812ea25f94d9d1d8e26
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Smalyshev <smalys...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to