From 51e0d5cd405d764a4ea257d1bac1fb1205f74528 Mon Sep 17 00:00:00 2001 From: uwetews Date: Tue, 6 Sep 2016 04:26:46 +0200 Subject: [PATCH] - performance require_once should be called only once for shared plugins https://github.com/smarty-php/smarty/issues/280 --- libs/plugins/modifier.date_format.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/plugins/modifier.date_format.php b/libs/plugins/modifier.date_format.php index a9b2997c9..bfe363c08 100644 --- a/libs/plugins/modifier.date_format.php +++ b/libs/plugins/modifier.date_format.php @@ -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 != '') {