Merge pull request #6082 from 3D-I/ticket/16641

[ticket/16641] Fix config.php validation in ACP - PHP 8
This commit is contained in:
Marc Alexander 2021-01-01 16:55:52 +01:00
commit dba60740f6
No known key found for this signature in database
GPG key ID: 50E0D2423696F995
2 changed files with 10 additions and 12 deletions

View file

@ -679,7 +679,7 @@ 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))
if (!defined('PHPBB_DISABLE_CONFIG_CHECK'))
{
// World-Writable? (000x)
$template->assign_var('S_WRITABLE_CONFIG', (bool) (@fileperms($phpbb_root_path . 'config.' . $phpEx) & 0x0002));
@ -690,6 +690,7 @@ class acp_main
$encoding_translation = $this->php_ini->getString('mbstring.encoding_translation');
$http_input = $this->php_ini->getString('mbstring.http_input');
$http_output = $this->php_ini->getString('mbstring.http_output');
if (extension_loaded('mbstring'))
{
$template->assign_vars(array(

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