mirror of
https://github.com/phpbb/phpbb.git
synced 2025-04-20 07:42:09 +02:00
[ticket/16641] Fix config.php validation in ACP - PHP 8
PHPBB3-16641
This commit is contained in:
parent
c0511d54fd
commit
cd42c0e306
@ -679,7 +679,11 @@ class acp_main
|
||||
}
|
||||
}
|
||||
|
||||
if (!defined('PHPBB_DISABLE_CONFIG_CHECK') && file_exists($phpbb_root_path . 'config.' . $phpEx) && $phpbb_filesystem->is_writable($phpbb_root_path . 'config.' . $phpEx))
|
||||
$config_ref = $phpbb_root_path . 'config.' . $phpEx;
|
||||
|
||||
if (!defined('PHPBB_DISABLE_CONFIG_CHECK') && file_exists($phpbb_root_path . 'config.' . $phpEx)
|
||||
&& (function_exists('is_writable') ? is_writable($config_ref) : $phpbb_filesystem->is_writable($config_ref))
|
||||
)
|
||||
{
|
||||
// World-Writable? (000x)
|
||||
$template->assign_var('S_WRITABLE_CONFIG', (bool) (@fileperms($phpbb_root_path . 'config.' . $phpEx) & 0x0002));
|
||||
|
@ -613,8 +613,11 @@ class filesystem implements filesystem_interface
|
||||
}
|
||||
else
|
||||
{
|
||||
if (is_writable($file))
|
||||
$handle = @fopen($file, 'c');
|
||||
|
||||
if (is_resource($handle))
|
||||
{
|
||||
fclose($handle);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user