From 4eb0d2fdb567a11193bf7bad1b6aadb85d7c2f4a Mon Sep 17 00:00:00 2001 From: Erik Bernhardson Date: Thu, 21 Sep 2017 12:18:57 -0700 Subject: [PATCH] getConfiguration: Don't bail when a valid variable is set null isset() will return false with a value is null. Null is an acceptable result for a configuration variable, so switch to array_key_exists. Change-Id: I11a3feb07d2bdc7ee30975014db29365086f89bc --- maintenance/getConfiguration.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maintenance/getConfiguration.php b/maintenance/getConfiguration.php index 3c679e6e7a..65ffe1422b 100644 --- a/maintenance/getConfiguration.php +++ b/maintenance/getConfiguration.php @@ -101,7 +101,7 @@ class GetConfiguration extends Maintenance { foreach ( $this->settings_list as $name ) { if ( !preg_match( '/^wg[A-Z]/', $name ) ) { throw new MWException( "Variable '$name' does start with 'wg'." ); - } elseif ( !isset( $GLOBALS[$name] ) ) { + } elseif ( !array_key_exists( $name, $GLOBALS ) ) { throw new MWException( "Variable '$name' is not set." ); } elseif ( !$this->isAllowedVariable( $GLOBALS[$name] ) ) { throw new MWException( "Variable '$name' includes non-array, non-scalar, items." ); -- 2.20.1