EtcdConfig: use array_key_exists(), the value can be null
authorTim Starling <tstarling@wikimedia.org>
Fri, 28 Apr 2017 05:14:57 +0000 (15:14 +1000)
committerTim Starling <tstarling@wikimedia.org>
Fri, 28 Apr 2017 05:16:26 +0000 (15:16 +1000)
Change-Id: Iae175401da8d49f5475d8c88cc5390b16e7cba32

includes/config/EtcdConfig.php

index d3fbd65..06d8dfb 100644 (file)
@@ -251,7 +251,7 @@ class EtcdConfig implements Config, LoggerAwareInterface {
 
                        $name = basename( $node['key'] );
                        $value = $this->unserialize( $node['value'] );
-                       if ( !is_array( $value ) || !isset( $value['val'] ) ) {
+                       if ( !is_array( $value ) || !array_key_exists( 'val', $value ) ) {
                                return [ null, "Failed to parse value for '$name'.", false ];
                        }