jenkins-bot has submitted this change and it was merged.

Change subject: Handle non-array values of ElasticaConnection::getServerList()
......................................................................


Handle non-array values of ElasticaConnection::getServerList()

This prevents warning messages, if there is a bad configured server list
in, e.g., CirrusSearch.

Change-Id: I8126cf422abb59aa30ab012020fd3c0941556315
---
M ElasticaConnection.php
1 file changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Manybubbles: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/ElasticaConnection.php b/ElasticaConnection.php
index 2e05a1f..73b9db4 100644
--- a/ElasticaConnection.php
+++ b/ElasticaConnection.php
@@ -75,7 +75,11 @@
                if ( $this->client === null ) {
                        // Setup the Elastica servers
                        $servers = array();
-                       foreach ( $this->getServerList() as $server ) {
+                       $serverList = $this->getServerList();
+                       if ( !is_array( $serverList ) ) {
+                               $serverList = array( $serverList );
+                       }
+                       foreach ( $serverList as $server ) {
                                if ( is_array( $server ) ) {
                                        $servers[] = $server;
                                } else {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8126cf422abb59aa30ab012020fd3c0941556315
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Elastica
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Manybubbles <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to