Avoid warnings when unable to parse the URL given to us
authorChad Horohoe <chadh@wikimedia.org>
Tue, 13 Sep 2016 21:07:32 +0000 (14:07 -0700)
committerChad Horohoe <chadh@wikimedia.org>
Tue, 13 Sep 2016 21:07:32 +0000 (14:07 -0700)
Change-Id: I56f1f36a3a54c6c23579f011d65dc75f30cb6dcf

includes/MediaWiki.php

index 7f20de1..0bd183f 100644 (file)
@@ -648,7 +648,11 @@ class MediaWiki {
                );
 
                foreach ( $clusterHosts as $clusterHost ) {
-                       $infoHost = array_intersect_key( wfParseUrl( $clusterHost ), $relevantKeys );
+                       $parseUrl = wfParseUrl( $clusterHost );
+                       if ( !$parseUrl ) {
+                               continue;
+                       }
+                       $infoHost = array_intersect_key( $parseUrl, $relevantKeys );
                        if ( $infoCandidate === $infoHost ) {
                                return true;
                        }