mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-02 17:34:26 +02:00
Do not use obsolete smarty properties '_dir_perms', '_file_perms', 'plugin_search_order' in our own code.
This commit is contained in:
@@ -29,12 +29,7 @@ class Smarty_Internal_Runtime_WriteFile
|
|||||||
{
|
{
|
||||||
$_error_reporting = error_reporting();
|
$_error_reporting = error_reporting();
|
||||||
error_reporting($_error_reporting & ~E_NOTICE & ~E_WARNING);
|
error_reporting($_error_reporting & ~E_NOTICE & ~E_WARNING);
|
||||||
$_file_perms = property_exists($smarty, '_file_perms') ? $smarty->_file_perms : 0644;
|
|
||||||
$_dir_perms =
|
|
||||||
property_exists($smarty, '_dir_perms') ? (isset($smarty->_dir_perms) ? $smarty->_dir_perms : 0777) : 0771;
|
|
||||||
if ($_file_perms !== null) {
|
|
||||||
$old_umask = umask(0);
|
$old_umask = umask(0);
|
||||||
}
|
|
||||||
$_dirpath = dirname($_filepath);
|
$_dirpath = dirname($_filepath);
|
||||||
// if subdirs, create dir structure
|
// if subdirs, create dir structure
|
||||||
if ($_dirpath !== '.') {
|
if ($_dirpath !== '.') {
|
||||||
@@ -42,7 +37,7 @@ class Smarty_Internal_Runtime_WriteFile
|
|||||||
// loop if concurrency problem occurs
|
// loop if concurrency problem occurs
|
||||||
// see https://bugs.php.net/bug.php?id=35326
|
// see https://bugs.php.net/bug.php?id=35326
|
||||||
while (!is_dir($_dirpath)) {
|
while (!is_dir($_dirpath)) {
|
||||||
if (@mkdir($_dirpath, $_dir_perms, true)) {
|
if (@mkdir($_dirpath, 0771, true)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
@@ -89,11 +84,9 @@ class Smarty_Internal_Runtime_WriteFile
|
|||||||
error_reporting($_error_reporting);
|
error_reporting($_error_reporting);
|
||||||
throw new SmartyException("unable to write file {$_filepath}");
|
throw new SmartyException("unable to write file {$_filepath}");
|
||||||
}
|
}
|
||||||
if ($_file_perms !== null) {
|
|
||||||
// set file permissions
|
// set file permissions
|
||||||
chmod($_filepath, $_file_perms);
|
chmod($_filepath, 0644);
|
||||||
umask($old_umask);
|
umask($old_umask);
|
||||||
}
|
|
||||||
error_reporting($_error_reporting);
|
error_reporting($_error_reporting);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -422,9 +422,6 @@ abstract class Smarty_Internal_TemplateCompilerBase
|
|||||||
try {
|
try {
|
||||||
// save template object in compiler class
|
// save template object in compiler class
|
||||||
$this->template = $template;
|
$this->template = $template;
|
||||||
if (property_exists($this->template->smarty, 'plugin_search_order')) {
|
|
||||||
$this->plugin_search_order = $this->template->smarty->plugin_search_order;
|
|
||||||
}
|
|
||||||
if ($this->smarty->debugging) {
|
if ($this->smarty->debugging) {
|
||||||
if (!isset($this->smarty->_debug)) {
|
if (!isset($this->smarty->_debug)) {
|
||||||
$this->smarty->_debug = new Smarty_Internal_Debug();
|
$this->smarty->_debug = new Smarty_Internal_Debug();
|
||||||
|
Reference in New Issue
Block a user