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:52:26 +09:00
parent 8c5e32945b
commit a83785bc42

View file

@ -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};