From a83785bc42d2aaba15b08aad34ce19969ecc7607 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 19 Dec 2018 15:52:26 +0900 Subject: [PATCH] Don't accept empty key for Context::set() and Context::get() https://xetown.com/questions/1130915 --- classes/context/Context.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index be92a7656..1d06955fa 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -1881,6 +1881,12 @@ class Context */ public static function get($key) { + if(empty($key)) + { + trigger_error('Called Context::get() with an empty key', \E_USER_WARNING); + return; + } + if(isset(self::$_tpl_vars->{$key})) { return self::$_tpl_vars->{$key};