mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 19:04:27 +02:00
- bugfix changed code when writing temporary compiled files to allow stream_wrapper
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
11/12/2010
|
||||
- bugfix nested block tags in template inheritance child templates did not work correctly
|
||||
- bugfix {$smarty.current_dir} in child template did not point to dir of child template
|
||||
- bugfix changed code when writing temporary compiled files to allow stream_wrapper
|
||||
|
||||
06/12/2010
|
||||
- bugfix getTemplateVars() should return 'null' instead dropping E_NOTICE on an unassigned variable
|
||||
|
@@ -30,11 +30,17 @@ class Smarty_Internal_Write_File {
|
||||
// write to tmp file, then move to overt file lock race condition
|
||||
$_tmp_file = tempnam($_dirpath, 'wrt');
|
||||
|
||||
if (!file_put_contents($_tmp_file, $_contents)) {
|
||||
umask($old_umask);
|
||||
if (!($fd = @fopen($_tmp_file, 'wb'))) {
|
||||
$_tmp_file = $_dirname . DS . uniqid('wrt');
|
||||
if (!($fd = @fopen($_tmp_file, 'wb'))) {
|
||||
throw new SmartyException("unable to write file {$_tmp_file}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fwrite($fd, $_contents);
|
||||
fclose($fd);
|
||||
|
||||
// remove original file
|
||||
if (file_exists($_filepath))
|
||||
@unlink($_filepath);
|
||||
|
Reference in New Issue
Block a user