From 56bd1fbbd081ad8b6189e537b145f756e33e4c65 Mon Sep 17 00:00:00 2001 From: mohrt Date: Wed, 17 Aug 2005 14:58:32 +0000 Subject: [PATCH] return valid reference in get_template_vars() when given var is non-existant --- NEWS | 4 +++- libs/Smarty.class.php | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 780dc35b..adc6a087 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ - - add escape type "urlpathinfo" to escape modifier + - return valid reference in get_template_vars() when given var is + non-existant (monte) + - add escape type "urlpathinfo" to escape modifier (monte) Version 2.6.10 (Aug 5, 2005) ---------------------------- diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 8a65e891..e6f3b88a 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -1055,9 +1055,12 @@ class Smarty { if(!isset($name)) { return $this->_tpl_vars; - } - if(isset($this->_tpl_vars[$name])) { + } elseif(isset($this->_tpl_vars[$name])) { return $this->_tpl_vars[$name]; + } else { + // var non-existant, return valid reference + $_tmp = null + return $_tmp; } }