mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-07 03:44:26 +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
|
11/12/2010
|
||||||
- bugfix nested block tags in template inheritance child templates did not work correctly
|
- 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 {$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
|
06/12/2010
|
||||||
- bugfix getTemplateVars() should return 'null' instead dropping E_NOTICE on an unassigned variable
|
- 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
|
// write to tmp file, then move to overt file lock race condition
|
||||||
$_tmp_file = tempnam($_dirpath, 'wrt');
|
$_tmp_file = tempnam($_dirpath, 'wrt');
|
||||||
|
|
||||||
if (!file_put_contents($_tmp_file, $_contents)) {
|
if (!($fd = @fopen($_tmp_file, 'wb'))) {
|
||||||
umask($old_umask);
|
$_tmp_file = $_dirname . DS . uniqid('wrt');
|
||||||
|
if (!($fd = @fopen($_tmp_file, 'wb'))) {
|
||||||
throw new SmartyException("unable to write file {$_tmp_file}");
|
throw new SmartyException("unable to write file {$_tmp_file}");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fwrite($fd, $_contents);
|
||||||
|
fclose($fd);
|
||||||
|
|
||||||
// remove original file
|
// remove original file
|
||||||
if (file_exists($_filepath))
|
if (file_exists($_filepath))
|
||||||
@unlink($_filepath);
|
@unlink($_filepath);
|
||||||
|
Reference in New Issue
Block a user