mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 11:24:27 +02:00
- bugfix on {block} if name did contain '-'
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
17/11/2010
|
||||
- bugfix on {call} with variable function name
|
||||
- bugfix on {block} if name did contain '-'
|
||||
|
||||
16/11/2010
|
||||
- bugfix whitespace in front of "<?php" in smarty_internal_compile_private_block_plugin.php
|
||||
|
@@ -49,7 +49,7 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_CompileBase {
|
||||
$_rdl = preg_quote($template->smarty->right_delimiter);
|
||||
$_ldl = preg_quote($template->smarty->left_delimiter);
|
||||
|
||||
if (0 == preg_match("!({$_ldl}block\s+)(name=)?(\w+|'\w+'|\"\w+\")(\s*?)?((append|prepend|nocache)(=true)?)?(\s*{$_rdl})!", $block_tag, $_match)) {
|
||||
if (0 == preg_match("!({$_ldl}block\s+)(name=)?(\w+|'.*'|\".*\")(\s*?)?((append|prepend|nocache)(=true)?)?(\s*{$_rdl})!", $block_tag, $_match)) {
|
||||
$error_text = 'Syntax Error in template "' . $template->getTemplateFilepath() . '" "' . htmlspecialchars($block_tag) . '" illegal options';
|
||||
throw new SmartyCompilerException($error_text);
|
||||
} else {
|
||||
@@ -167,6 +167,7 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_CompileBase {
|
||||
$_attr = $this->_get_attributes($args);
|
||||
$saved_data = $this->_close_tag(array('block'));
|
||||
$_name = trim($saved_data[0]['name'], "\"'");
|
||||
var_dump($_name);
|
||||
if (isset($compiler->template->block_data[$_name]) && !isset($compiler->template->block_data[$_name]['compiled'])) {
|
||||
$_output = Smarty_Internal_Compile_Block::compileChildBlock($compiler, $_name);
|
||||
} else {
|
||||
|
@@ -38,7 +38,7 @@ class Smarty_Internal_Compile_Call extends Smarty_Internal_CompileBase {
|
||||
// output will be stored in a smarty variable instead of beind displayed
|
||||
$_assign = $_attr['assign'];
|
||||
}
|
||||
$_name = trim($_attr['name'], "'\"");
|
||||
$_name = $_attr['name'];
|
||||
unset($_attr['name'], $_attr['assign'], $_attr['nocache']);
|
||||
// set flag (compiled code of {function} must be included in cache file
|
||||
if ($compiler->nocache || $compiler->tag_nocache) {
|
||||
@@ -78,8 +78,9 @@ class Smarty_Internal_Compile_Call extends Smarty_Internal_CompileBase {
|
||||
//varibale name?
|
||||
if (!(strpos($_name,'$')===false)) {
|
||||
$call_cache = $_name;
|
||||
$call_function = "\$tmp = \"smarty_template_function_{{$_name}}\"; \$tmp";
|
||||
$call_function = '$tmp = "smarty_template_function_".'.$_name.'; $tmp';
|
||||
} else {
|
||||
$_name = trim($_name, "'\"");
|
||||
$call_cache = "'{$_name}'";
|
||||
$call_function = 'smarty_template_function_'.$_name;
|
||||
}
|
||||
|
Reference in New Issue
Block a user