From b73d2a7e63323d16727bdf008dc49d7b93635b83 Mon Sep 17 00:00:00 2001 From: messju Date: Fri, 16 Apr 2004 08:03:07 +0000 Subject: [PATCH] reverted stuff --- libs/core/core.assemble_plugin_filepath.php | 11 +++++------ libs/core/core.read_cache_file.php | 3 --- libs/core/core.write_file.php | 4 +--- libs/debug.tpl | 4 ++-- libs/plugins/function.eval.php | 2 +- libs/plugins/function.popup.php | 4 +--- libs/plugins/modifier.escape.php | 7 +------ libs/plugins/shared.make_timestamp.php | 16 +++++++--------- 8 files changed, 18 insertions(+), 33 deletions(-) diff --git a/libs/core/core.assemble_plugin_filepath.php b/libs/core/core.assemble_plugin_filepath.php index 48f6d2c4..cb8f5441 100644 --- a/libs/core/core.assemble_plugin_filepath.php +++ b/libs/core/core.assemble_plugin_filepath.php @@ -29,6 +29,11 @@ function smarty_core_assemble_plugin_filepath($params, &$smarty) // see if path is relative if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $_plugin_dir)) { $_relative_paths[] = $_plugin_dir; + // relative path, see if it is in the SMARTY_DIR + if (@is_readable(SMARTY_DIR . $_plugin_filepath)) { + $_return = SMARTY_DIR . $_plugin_filepath; + break; + } } // try relative to cwd (or absolute) if (@is_readable($_plugin_filepath)) { @@ -50,12 +55,6 @@ function smarty_core_assemble_plugin_filepath($params, &$smarty) $_return = $_params['new_file_path']; break; } - // maybe it is in the SMARTY_DIR - if (@is_readable(SMARTY_DIR . $_plugin_filepath)) { - $_return = SMARTY_DIR . $_plugin_filepath; - break; - } - } } } diff --git a/libs/core/core.read_cache_file.php b/libs/core/core.read_cache_file.php index dcecc384..2ab42811 100644 --- a/libs/core/core.read_cache_file.php +++ b/libs/core/core.read_cache_file.php @@ -41,7 +41,6 @@ function smarty_core_read_cache_file(&$params, &$smarty) $_auto_id = $smarty->_get_auto_id($params['cache_id'], $params['compile_id']); $_cache_file = $smarty->_get_auto_filename($smarty->cache_dir, $params['tpl_file'], $_auto_id); $params['results'] = $smarty->_read_file($_cache_file); - # $params['results'] = file_get_contents($_cache_file); } if (empty($params['results'])) { @@ -53,8 +52,6 @@ function smarty_core_read_cache_file(&$params, &$smarty) $cache_header = $cache_split[0]; $_cache_info = unserialize($cache_header); - if (!isset($_cache_info['expires'])) - $_cache_info['expires'] = time() + $smarty->cache_lifetime; if ($smarty->caching == 2 && isset ($_cache_info['expires'])){ // caching by expiration time diff --git a/libs/core/core.write_file.php b/libs/core/core.write_file.php index 3adaf9e3..b4fa92e5 100644 --- a/libs/core/core.write_file.php +++ b/libs/core/core.write_file.php @@ -25,9 +25,7 @@ function smarty_core_write_file($params, &$smarty) // write to tmp file, then rename it to avoid // file locking race condition - # $_tmp_file = $_dirname . DIRECTORY_SEPARATOR . uniqid(''); - $_tmp_file = tempnam($_dirname , '_tmp'); - # $_tmp_file = $_dirname . DIRECTORY_SEPARATOR . uniqid('', true); + $_tmp_file = $_dirname . DIRECTORY_SEPARATOR . uniqid(''); if (!($fd = @fopen($_tmp_file, 'w'))) { $smarty->trigger_error("problem writing temporary file '$_tmp_file'"); diff --git a/libs/debug.tpl b/libs/debug.tpl index 4d04b8d0..01265fb4 100644 --- a/libs/debug.tpl +++ b/libs/debug.tpl @@ -29,14 +29,14 @@ {else}