diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index ffc830ec90..75c717728d 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -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)); diff --git a/phpBB/phpbb/filesystem/filesystem.php b/phpBB/phpbb/filesystem/filesystem.php index 3749d12b48..7f44d5f1de 100644 --- a/phpBB/phpbb/filesystem/filesystem.php +++ b/phpBB/phpbb/filesystem/filesystem.php @@ -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; } }