[ticket/16641] Fix config.php validation in ACP - PHP 8

PHPBB3-16641
This commit is contained in:
3D-I 2020-11-27 20:50:06 +01:00
parent 146d72468f
commit 4e8b104543
2 changed files with 5 additions and 9 deletions

View file

@ -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));

View file

@ -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