mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
fixed bug in assign function when passing an empty value
This commit is contained in:
2
NEWS
2
NEWS
@@ -1,3 +1,5 @@
|
||||
- fixed bug with {assign ...} when passing an empty value (Monte)
|
||||
- add more warning message fixes (Monte, Tara Johnson)
|
||||
- documentation updates. (Monte)
|
||||
- update fetch function to give proper warning when fetching a non-readable
|
||||
or non-existant file. (Monte)
|
||||
|
@@ -193,7 +193,7 @@ function smarty_func_assign($args, &$smarty_obj)
|
||||
return;
|
||||
}
|
||||
|
||||
if (empty($value)) {
|
||||
if (!isset($value)) {
|
||||
$smarty_obj->_trigger_error_msg("assign: missing 'value' parameter");
|
||||
return;
|
||||
}
|
||||
|
@@ -236,8 +236,9 @@ class Smarty
|
||||
{
|
||||
if (is_array($tpl_var)){
|
||||
foreach ($tpl_var as $key => $val) {
|
||||
if (!empty($key))
|
||||
if (!empty($key) && isset($val)) {
|
||||
$this->_tpl_vars[$key] = $val;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!empty($tpl_var) && isset($value))
|
||||
@@ -650,7 +651,7 @@ class Smarty
|
||||
$smarty['request'] = array_merge($smarty['request'], $smarty[$egpcs[$c]]);
|
||||
}
|
||||
}
|
||||
$smarty['request'] = array_merge($smarty['request'], $smarty['session']);
|
||||
$smarty['request'] = @array_merge($smarty['request'], $smarty['session']);
|
||||
|
||||
$smarty['now'] = time();
|
||||
|
||||
@@ -1193,7 +1194,7 @@ function _run_mod_handler()
|
||||
$new_dir = ($dir{0} == '/') ? '/' : '';
|
||||
foreach ($dir_parts as $dir_part) {
|
||||
$new_dir .= $dir_part;
|
||||
if (!file_exists($new_dir) && !mkdir($new_dir, 0701)) {
|
||||
if (!file_exists($new_dir) && !mkdir($new_dir, 0771)) {
|
||||
$this->_trigger_error_msg("problem creating directory \"$dir\"");
|
||||
return false;
|
||||
}
|
||||
|
@@ -401,6 +401,7 @@ class Smarty_Compiler extends Smarty {
|
||||
function _compile_include_tag($tag_args)
|
||||
{
|
||||
$attrs = $this->_parse_attrs($tag_args);
|
||||
$arg_list = array();
|
||||
|
||||
if (empty($attrs['file'])) {
|
||||
$this->_syntax_error("missing 'file' attribute in include tag");
|
||||
|
@@ -1,5 +1,7 @@
|
||||
{* Smarty *}
|
||||
|
||||
{* debug.tpl, last updated version 1.4.6 *}
|
||||
|
||||
{assign_debug_info}
|
||||
|
||||
<SCRIPT language=javascript>
|
||||
|
@@ -236,8 +236,9 @@ class Smarty
|
||||
{
|
||||
if (is_array($tpl_var)){
|
||||
foreach ($tpl_var as $key => $val) {
|
||||
if (!empty($key))
|
||||
if (!empty($key) && isset($val)) {
|
||||
$this->_tpl_vars[$key] = $val;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!empty($tpl_var) && isset($value))
|
||||
@@ -650,7 +651,7 @@ class Smarty
|
||||
$smarty['request'] = array_merge($smarty['request'], $smarty[$egpcs[$c]]);
|
||||
}
|
||||
}
|
||||
$smarty['request'] = array_merge($smarty['request'], $smarty['session']);
|
||||
$smarty['request'] = @array_merge($smarty['request'], $smarty['session']);
|
||||
|
||||
$smarty['now'] = time();
|
||||
|
||||
@@ -1193,7 +1194,7 @@ function _run_mod_handler()
|
||||
$new_dir = ($dir{0} == '/') ? '/' : '';
|
||||
foreach ($dir_parts as $dir_part) {
|
||||
$new_dir .= $dir_part;
|
||||
if (!file_exists($new_dir) && !mkdir($new_dir, 0701)) {
|
||||
if (!file_exists($new_dir) && !mkdir($new_dir, 0771)) {
|
||||
$this->_trigger_error_msg("problem creating directory \"$dir\"");
|
||||
return false;
|
||||
}
|
||||
|
@@ -401,6 +401,7 @@ class Smarty_Compiler extends Smarty {
|
||||
function _compile_include_tag($tag_args)
|
||||
{
|
||||
$attrs = $this->_parse_attrs($tag_args);
|
||||
$arg_list = array();
|
||||
|
||||
if (empty($attrs['file'])) {
|
||||
$this->_syntax_error("missing 'file' attribute in include tag");
|
||||
|
@@ -1,5 +1,7 @@
|
||||
{* Smarty *}
|
||||
|
||||
{* debug.tpl, last updated version 1.4.6 *}
|
||||
|
||||
{assign_debug_info}
|
||||
|
||||
<SCRIPT language=javascript>
|
||||
|
Reference in New Issue
Block a user