- bugfix isset() did not allow multiple parameter

- improvment of some error messages
- bugfix html_image did use removed property $request_use_auto_globals
This commit is contained in:
uwe.tews@googlemail.com
2010-11-14 15:08:44 +00:00
parent 6ff5c28343
commit 7135787127
5 changed files with 882 additions and 867 deletions

View File

@@ -1,3 +1,8 @@
14/11/2010
- bugfix isset() did not allow multiple parameter
- improvment of some error messages
- bugfix html_image did use removed property $request_use_auto_globals
13/11/2010 13/11/2010
- bugfix overloading problem when $smarty->fetch()/display() have been used in plugins - bugfix overloading problem when $smarty->fetch()/display() have been used in plugins
(introduced with 3.0.2) (introduced with 3.0.2)
@@ -34,7 +39,7 @@
09/11/2010 09/11/2010
-bugfix on complex expressions as start value for {for} tag -bugfix on complex expressions as start value for {for} tag
request_use_auto_globals
04/11/2010 04/11/2010
- bugfix do not allow access of dynamic and private object members of assigned objects when - bugfix do not allow access of dynamic and private object members of assigned objects when
security is enabled. security is enabled.

View File

@@ -45,7 +45,7 @@ function smarty_function_html_image($params, $template)
$prefix = ''; $prefix = '';
$suffix = ''; $suffix = '';
$path_prefix = ''; $path_prefix = '';
$server_vars = ($template->request_use_auto_globals) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS']; $server_vars = $_SERVER;
$basedir = isset($server_vars['DOCUMENT_ROOT']) ? $server_vars['DOCUMENT_ROOT'] : ''; $basedir = isset($server_vars['DOCUMENT_ROOT']) ? $server_vars['DOCUMENT_ROOT'] : '';
foreach($params as $_key => $_val) { foreach($params as $_key => $_val) {
switch ($_key) { switch ($_key) {

View File

@@ -50,7 +50,8 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_CompileBase {
$_ldl = preg_quote($template->smarty->left_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+|'\w+'|\"\w+\")(\s*?)?((append|prepend|nocache)(=true)?)?(\s*{$_rdl})!", $block_tag, $_match)) {
$template->compiler_object->trigger_template_error('Illegal {block} tag syntax'); $error_text = 'Syntax Error in template "' . $template->getTemplateFilepath() . '" "' . htmlspecialchars($block_tag) . '" illegal options';
throw new SmartyCompilerException($error_text);
} else { } else {
$_name = trim($_match[3], '\'"'); $_name = trim($_match[3], '\'"');
// replace {$smarty.block.child} // replace {$smarty.block.child}
@@ -101,7 +102,11 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_CompileBase {
} }
} }
if ($_name == null) { if ($_name == null) {
$compiler->trigger_template_error('{$smarty.block.child} used out of context'); $compiler->trigger_template_error('{$smarty.block.child} used out of context', $this->compiler->lex->taglineno);
}
// undefined child?
if (!isset($compiler->template->block_data[$_name])) {
return '';
} }
$_tpl = new Smarty_Internal_template ('eval:' . $compiler->template->block_data[$_name]['source'], $compiler->smarty, $compiler->template, $compiler->template->cache_id, $_tpl = new Smarty_Internal_template ('eval:' . $compiler->template->block_data[$_name]['source'], $compiler->smarty, $compiler->template, $compiler->template->cache_id,
$compiler->template->compile_id = null, $compiler->template->caching, $compiler->template->cache_lifetime); $compiler->template->compile_id = null, $compiler->template->caching, $compiler->template->cache_lifetime);

View File

@@ -37,7 +37,7 @@ class Smarty_Internal_Compile_Foreach extends Smarty_Internal_CompileBase {
$item = $_attr['item']; $item = $_attr['item'];
if (substr_compare("\$_smarty_tpl->getVariable($item)", $from,0, strlen("\$_smarty_tpl->getVariable($item)")) == 0) { if (substr_compare("\$_smarty_tpl->getVariable($item)", $from,0, strlen("\$_smarty_tpl->getVariable($item)")) == 0) {
$this->compiler->trigger_template_error("item parameter {$item} may not be the same parameter at 'from'"); $this->compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $this->compiler->lex->taglineno);
} }
if (isset($_attr['key'])) { if (isset($_attr['key'])) {

File diff suppressed because it is too large Load Diff