- bugfix on error message in smarty_internal_compile_block.php

- bugfix mb handling in strip modifier
- bugfix for Smarty2 style registered compiler function on unnamed attribute passing like {tag $foo $bar}
This commit is contained in:
uwe.tews@googlemail.com
2011-03-28 22:18:39 +00:00
parent 6b0f3a6ede
commit 1757b274d6
4 changed files with 132 additions and 123 deletions

View File

@@ -1,4 +1,9 @@
===== SVN trunk ===== ===== SVN trunk =====
29/03/2011
- bugfix on error message in smarty_internal_compile_block.php
- bugfix mb handling in strip modifier
- bugfix for Smarty2 style registered compiler function on unnamed attribute passing like {tag $foo $bar}
17/03/2011 17/03/2011
- bugfix on default {function} parameters when {function} was used in nocache sections - bugfix on default {function} parameters when {function} was used in nocache sections
- bugfix on compiler object destruction. compiler_object property was by mistake unset. - bugfix on compiler object destruction. compiler_object property was by mistake unset.

View File

@@ -27,7 +27,7 @@ function smarty_modifiercompiler_strip($params, $compiler)
if (!isset($params[1])) { if (!isset($params[1])) {
$params[1] = "' '"; $params[1] = "' '";
} }
return "preg_replace('!\s+!', {$params[1]},{$params[0]})"; return "preg_replace('!\s+!u', {$params[1]},{$params[0]})";
} }
?> ?>

View File

@@ -104,7 +104,7 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_CompileBase {
$compiler->template->block_data[$_name]['compiled'] = true; $compiler->template->block_data[$_name]['compiled'] = true;
} }
if ($_name == null) { if ($_name == null) {
$compiler->trigger_template_error('{$smarty.block.child} used out of context', $this->compiler->lex->taglineno); $compiler->trigger_template_error('{$smarty.block.child} used out of context', $compiler->lex->taglineno);
} }
// undefined child? // undefined child?
if (!isset($compiler->template->block_data[$_name])) { if (!isset($compiler->template->block_data[$_name])) {

View File

@@ -172,8 +172,12 @@ class Smarty_Internal_TemplateCompilerBase {
// if compiler function plugin call it now // if compiler function plugin call it now
if ($type == Smarty::PLUGIN_COMPILER) { if ($type == Smarty::PLUGIN_COMPILER) {
$new_args = array(); $new_args = array();
foreach ($args as $mixed) { foreach ($args as $key => $mixed) {
$new_args = array_merge($new_args, $mixed); if (is_array($mixed)) {
$new_args = array_merge($new_args, $mixed);
} else {
$new_args[$key] = $mixed;
}
} }
if (!$this->smarty->registered_plugins[$type][$tag][1]) { if (!$this->smarty->registered_plugins[$type][$tag][1]) {
$this->tag_nocache = true; $this->tag_nocache = true;