commit 0a7de434924e588a68edcf1059830db06be068b4 parent df21d9366a88d2c72c57d9c4abf93968e41fa952 Author: Marcel <MTRNord@users.noreply.github.com> Date: Sat, 31 Oct 2015 17:50:06 +0100 Create smarty_undefined_variable.php Diffstat:
| A | libs/smarty/sysplugins/smarty_undefined_variable.php | | | 37 | +++++++++++++++++++++++++++++++++++++ |
1 file changed, 37 insertions(+), 0 deletions(-)
diff --git a/libs/smarty/sysplugins/smarty_undefined_variable.php b/libs/smarty/sysplugins/smarty_undefined_variable.php @@ -0,0 +1,37 @@ +<?php + +/** + * class for undefined variable object + * This class defines an object for undefined variable handling + * + * @package Smarty + * @subpackage Template + */ +class Smarty_Undefined_Variable +{ + /** + * Returns FALSE for 'nocache' and NULL otherwise. + * + * @param string $name + * + * @return bool + */ + public function __get($name) + { + if ($name == 'nocache') { + return false; + } else { + return null; + } + } + + /** + * Always returns an empty string. + * + * @return string + */ + public function __toString() + { + return ""; + } +}