Don't accept empty key for Context::set() and Context::get()

https://xetown.com/questions/1130915
This commit is contained in:
Kijin Sung 2018-12-19 15:51:23 +09:00
parent 0f91ab3204
commit 8c5e32945b

View file

@ -1852,6 +1852,12 @@ class Context
*/
public static function set($key, $val, $set_to_get_vars = false)
{
if(empty($key))
{
trigger_error('Called Context::set() with an empty key', \E_USER_WARNING);
return;
}
self::$_tpl_vars->{$key} = $val;
if($set_to_get_vars || isset(self::$_get_vars->{$key}))