- bugfix convert each word of class names to ucfirst in in compiler. (forum topic 25588)

This commit is contained in:
Uwe Tews
2015-07-08 04:59:37 +02:00
parent 40f0dda0e6
commit 7a56edc180
2 changed files with 6 additions and 1 deletions

View File

@@ -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

View File

@@ -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 {