GlobalVarConfig shouldn't throw exceptions for null-valued config settings
authorBrad Jorsch <bjorsch@wikimedia.org>
Mon, 23 Jun 2014 17:03:53 +0000 (13:03 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Mon, 23 Jun 2014 17:03:53 +0000 (13:03 -0400)
Use array_key_exists rather than isset to test $GLOBALS.

Bug: 66986
Change-Id: I9beabd79e1d52966b9184c9647af5a2a31c19276

includes/config/GlobalVarConfig.php

index 61a76b7..0d7f3f0 100644 (file)
@@ -69,7 +69,7 @@ class GlobalVarConfig implements Config {
         */
        protected function getWithPrefix( $prefix, $name ) {
                $var = $prefix . $name;
-               if ( !isset( $GLOBALS[ $var ] ) ) {
+               if ( !array_key_exists( $var, $GLOBALS ) ) {
                        throw new ConfigException( __METHOD__ . ": undefined variable: '$var'" );
                }
                return $GLOBALS[ $var ];