From 05933749c0fc1681d990dc95d7f10910e57cfd15 Mon Sep 17 00:00:00 2001 From: uwetews Date: Fri, 11 Nov 2016 23:09:28 +0100 Subject: [PATCH] - smaller speed optimization --- change_log.txt | 1 + libs/Smarty.class.php | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/change_log.txt b/change_log.txt index 13837f30..19facf61 100644 --- a/change_log.txt +++ b/change_log.txt @@ -2,6 +2,7 @@ 11.11.2016 - bugfix when Smarty is using a cached template object on Smarty::fetch() or Smarty::isCached() the inheritance data must be removed https://github.com/smarty-php/smarty/issues/312 + - smaller speed optimization 08.11.2016 - add bootstrap file to load and register Smarty_Autoloader. Change composer.json to make it known to composer diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index cad61e7d..1989c73a 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -108,7 +108,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.31-dev/43'; + const SMARTY_VERSION = '3.1.31-dev/44'; /** * define variable scopes @@ -1265,8 +1265,9 @@ class Smarty extends Smarty_Internal_TemplateBase * * @return bool */ - public function _isNewRelease ($dir) { - if (!is_file($file = $dir. 'version.txt') || file_get_contents($file) !== Smarty::SMARTY_VERSION) { + public function _isNewRelease($dir) + { + if (!is_file($file = $dir . preg_replace('#[^a-zA-Z0-9.-]#', '.', Smarty::SMARTY_VERSION) . 'version.txt')) { file_put_contents($file, Smarty::SMARTY_VERSION); return true; } else {