- performance require_once should be called only once for shared plugins https://github.com/smarty-php/smarty/issues/280

This commit is contained in:
uwetews
2016-09-06 04:26:46 +02:00
parent e1d27d68d7
commit 51e0d5cd40

View File

@@ -32,6 +32,12 @@ function smarty_modifier_date_format($string, $format = null, $default_date = ''
if ($format === null) {
$format = Smarty::$_DATE_FORMAT;
}
/**
* require_once the {@link shared.make_timestamp.php} plugin
*/
if (!is_callable('smarty_make_timestamp')) {
require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php');
}
if ($string != '' && $string != '0000-00-00' && $string != '0000-00-00 00:00:00') {
$timestamp = smarty_make_timestamp($string);
} elseif ($default_date != '') {