Skip to content

Commit

Permalink
- bugfix in date-format modifier; NULL at date string or default_date…
Browse files Browse the repository at this point in the history
… did not produce correct output

   #458
  • Loading branch information
uwetews committed Oct 11, 2018
1 parent c930f0e commit b05bc1b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion change_log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
11.10.2018
- bugfix {insert} not works when caching is enabled and included template is present
https://github.com/smarty-php/smarty/issues/496

- bugfix in date-format modifier; NULL at date string or default_date did not produce correct output
https://github.com/smarty-php/smarty/pull/458

09.10.2018
- bugfix fix of 26.8.2017 https://github.com/smarty-php/smarty/issues/327
modifier is applied to sum expression https://github.com/smarty-php/smarty/issues/491
Expand Down
2 changes: 1 addition & 1 deletion libs/Smarty.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/**
* smarty version
*/
const SMARTY_VERSION = '3.1.34-dev-3';
const SMARTY_VERSION = '3.1.34-dev-4';
/**
* define variable scopes
*/
Expand Down
4 changes: 2 additions & 2 deletions libs/plugins/modifier.date_format.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ function smarty_modifier_date_format($string, $format = null, $default_date = ''
}
$is_loaded = true;
}
if ($string !== '' && $string !== '0000-00-00' && $string !== '0000-00-00 00:00:00') {
if (!empty($string) && $string !== '0000-00-00' && $string !== '0000-00-00 00:00:00') {
$timestamp = smarty_make_timestamp($string);
} elseif ($default_date !== '') {
} elseif (!empty($default_date)) {
$timestamp = smarty_make_timestamp($default_date);
} else {
return;
Expand Down

0 comments on commit b05bc1b

Please sign in to comment.