mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-11 13:02:15 +09:00
Don't accept empty key for Context::set() and Context::get()
https://xetown.com/questions/1130915
This commit is contained in:
parent
8c5e32945b
commit
a83785bc42
1 changed files with 6 additions and 0 deletions
|
|
@ -1881,6 +1881,12 @@ class Context
|
||||||
*/
|
*/
|
||||||
public static function get($key)
|
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}))
|
if(isset(self::$_tpl_vars->{$key}))
|
||||||
{
|
{
|
||||||
return self::$_tpl_vars->{$key};
|
return self::$_tpl_vars->{$key};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue