- bugfix Smarty version was not filled in header comment of compiled and cached files

This commit is contained in:
Uwe Tews
2017-10-26 05:09:07 +02:00
parent 87f260e3a9
commit c404294a1f
2 changed files with 15 additions and 18 deletions

View File

@@ -1,4 +1,7 @@
===== 3.1.32 - dev ===
26.10.2017 3.1.32-dev-28
- bugfix Smarty version was not filled in header comment of compiled and cached files
21.10.2017
- bugfix custom delimiters could fail since modification of version 3.1.32-dev-23
https://github.com/smarty-php/smarty/issues/394

View File

@@ -6,7 +6,6 @@
* @subpackage PluginsInternal
* @author Monte Ohrt
*/
/**
* Smarty Internal Write File Class
*
@@ -35,12 +34,10 @@ class Smarty_Internal_Runtime_WriteFile
if ($_file_perms !== null) {
$old_umask = umask(0);
}
$_dirpath = dirname($_filepath);
// if subdirs, create dir structure
if ($_dirpath !== '.') {
$i=0;
$i = 0;
// loop if concurrency problem occurs
// see https://bugs.php.net/bug.php?id=35326
while (!is_dir($_dirpath)) {
@@ -55,14 +52,12 @@ class Smarty_Internal_Runtime_WriteFile
sleep(1);
}
}
// write to tmp file, then move to overt file lock race condition
$_tmp_file = $_dirpath . $smarty->ds . str_replace(array('.', ','), '_', uniqid('wrt', true));
$_tmp_file = $_dirpath . DIRECTORY_SEPARATOR . str_replace(array('.', ','), '_', uniqid('wrt', true));
if (!file_put_contents($_tmp_file, $_contents)) {
error_reporting($_error_reporting);
throw new SmartyException("unable to write file {$_tmp_file}");
}
/*
* Windows' rename() fails if the destination exists,
* Linux' rename() properly handles the overwrite.
@@ -99,7 +94,6 @@ class Smarty_Internal_Runtime_WriteFile
umask($old_umask);
}
error_reporting($_error_reporting);
return true;
}
}