mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/16641] Fix config.php validation in ACP - PHP 8
PHPBB3-16641
This commit is contained in:
parent
146d72468f
commit
4e8b104543
2 changed files with 5 additions and 9 deletions
|
@ -679,11 +679,10 @@ class acp_main
|
|||
}
|
||||
}
|
||||
|
||||
// We define the variable so we avoid redundancies
|
||||
$config_ref = $phpbb_root_path . 'config.' . $phpEx;
|
||||
|
||||
if (!defined('PHPBB_DISABLE_CONFIG_CHECK') && file_exists($config_ref)
|
||||
&& (function_exists('is_writable') ? is_writable($config_ref) : $phpbb_filesystem->is_writable($config_ref))
|
||||
)
|
||||
if (!defined('PHPBB_DISABLE_CONFIG_CHECK') && file_exists($config_ref) && $phpbb_filesystem->is_writable($config_ref))
|
||||
{
|
||||
// World-Writable? (000x)
|
||||
$template->assign_var('S_WRITABLE_CONFIG', (bool) (@fileperms($config_ref) & 0x0002));
|
||||
|
|
|
@ -613,13 +613,10 @@ class filesystem implements filesystem_interface
|
|||
}
|
||||
else
|
||||
{
|
||||
$handle = @fopen($file, 'c');
|
||||
$handle = new \SplFileInfo($file);
|
||||
|
||||
if (is_resource($handle))
|
||||
{
|
||||
fclose($handle);
|
||||
return true;
|
||||
}
|
||||
// Returns TRUE if writable, FALSE otherwise
|
||||
return $handle->isWritable();
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue