diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 368e7c5996..a222bfa1cc 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -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)); diff --git a/phpBB/phpbb/filesystem/filesystem.php b/phpBB/phpbb/filesystem/filesystem.php index 7f44d5f1de..fc7cbdf27d 100644 --- a/phpBB/phpbb/filesystem/filesystem.php +++ b/phpBB/phpbb/filesystem/filesystem.php @@ -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