- bugfix {html_select_date} and {html_select_time} did not properly handle empty time arguments (Forum Topic 20190)

see http://www.smarty.net/forums/viewtopic.php?t=20190
This commit is contained in:
rodneyrehm
2011-10-20 13:31:25 +00:00
parent b71323ca24
commit 922017c7fa
3 changed files with 13 additions and 12 deletions

View File

@@ -116,7 +116,7 @@ function smarty_function_html_select_date($params, $template)
foreach ($params as $_key => $_value) {
switch ($_key) {
case 'time':
if (!is_array($_value)) {
if (!is_array($_value) && $_value !== null) {
$time = smarty_make_timestamp($_value);
}
break;
@@ -202,7 +202,8 @@ function smarty_function_html_select_date($params, $template)
list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d'));
}
} elseif ($time === null) {
list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d'));
//list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d'));
$_year = $_month = $_day = $time = null;
} else {
list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d', $time));
}