From c01bc0d815b6f43bb061d02191c3dce25034e4d7 Mon Sep 17 00:00:00 2001 From: Dale Davies Date: Fri, 14 Apr 2023 11:44:05 +0100 Subject: [PATCH] Make Config::get() case insensitive --- jumpapp/classes/Config.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jumpapp/classes/Config.php b/jumpapp/classes/Config.php index 2e44d15..155d76a 100644 --- a/jumpapp/classes/Config.php +++ b/jumpapp/classes/Config.php @@ -111,11 +111,12 @@ class Config { * Retrieves the config parameter provided in $key, first checks for its * existence. * - * @param string $key The requested config parameter key. + * @param string $key The requested config parameter key, not case sensitive. * @param bool $strict Throw exception if requested param is not found, or return null. * @return mixed The selected value from the configuration array. */ public function get(string $key, $strict = true): mixed { + $key = strtolower($key); if (!$this->config->has($key) && $strict === true) { throw new ConfigException('Config key does not exist... ('.$key.')'); }