From 7a56edc180467d666f1913b84d16e4b25a7f4aa2 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Wed, 8 Jul 2015 04:59:37 +0200 Subject: [PATCH] - bugfix convert each word of class names to ucfirst in in compiler. (forum topic 25588) --- change_log.txt | 3 +++ libs/sysplugins/smarty_internal_templatecompilerbase.php | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/change_log.txt b/change_log.txt index 5e6e2b26..d23a4218 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@  ===== 3.1.28-dev===== (xx.xx.2015) + 08.07.2015 + - bugfix convert each word of class names to ucfirst in in compiler. (forum topic 25588) + 07.07.2015 - improvement allow fetch() or display() called on a template object to get output from other template like $template->fetch('foo.tpl') https://github.com/smarty-php/smarty/issues/70 diff --git a/libs/sysplugins/smarty_internal_templatecompilerbase.php b/libs/sysplugins/smarty_internal_templatecompilerbase.php index 8997a31a..ef1f4f60 100644 --- a/libs/sysplugins/smarty_internal_templatecompilerbase.php +++ b/libs/sysplugins/smarty_internal_templatecompilerbase.php @@ -760,7 +760,9 @@ abstract class Smarty_Internal_TemplateCompilerBase // re-use object if already exists if (!isset($this->_tag_objects[$tag])) { // lazy load internal compiler plugin - $class_name = 'Smarty_Internal_Compile_' . ucfirst($tag); + $_tag=explode('_', $tag); + $_tag=array_map(function($word) { return ucfirst($word); }, $_tag); + $class_name = 'Smarty_Internal_Compile_' . implode('_',$_tag); if (class_exists($class_name) && (!isset($this->smarty->security_policy) || $this->smarty->security_policy->isTrustedTag($tag, $this))) { $this->_tag_objects[$tag] = new $class_name; } else {