From 6851c57ef8db452e25c79b0d62a7d6f9e1669e04 Mon Sep 17 00:00:00 2001 From: "Uwe.Tews@googlemail.com" Date: Sat, 27 Jul 2013 10:06:43 +0000 Subject: [PATCH] - enhancement allow access to properties of registered opjects for Smarty2 BC (forum topic 24344) --- libs/sysplugins/smarty_internal_templatebase.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/sysplugins/smarty_internal_templatebase.php b/libs/sysplugins/smarty_internal_templatebase.php index 8bbbfdcd..dc7ae883 100644 --- a/libs/sysplugins/smarty_internal_templatebase.php +++ b/libs/sysplugins/smarty_internal_templatebase.php @@ -525,8 +525,8 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data // test if allowed methodes callable if (!empty($allowed)) { foreach ((array) $allowed as $method) { - if (!is_callable(array($object_impl, $method))) { - throw new SmartyException("Undefined method '$method' in registered object"); + if (!is_callable(array($object_impl, $method)) && !property_exists($object_impl, $method)) { + throw new SmartyException("Undefined method or property '$method' in registered object"); } } }