diff --git a/phpBB/install/startup.php b/phpBB/install/startup.php index 4e012216a6..71f5744678 100644 --- a/phpBB/install/startup.php +++ b/phpBB/install/startup.php @@ -159,9 +159,9 @@ function installer_shutdown_function($display_errors) installer_class_loader($phpbb_root_path, $phpEx); $supported_error_levels = E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_USER_DEPRECATED; - $cache = new \phpbb\cache\driver\file(__DIR__ . '/../cache/installer'); + $cache = new \phpbb\cache\driver\file(__DIR__ . '/../cache/installer/'); $filesystem = new \phpbb\filesystem\filesystem(); - if (strpos($error['file'], $filesystem->realpath($cache->cache_dir)) !== false) + if (strpos($error['file'], $filesystem->realpath($cache->cache_dir)) !== false && is_writable($cache->cache_dir)) { $file_age = @filemtime($error['file']); diff --git a/phpBB/phpbb/cache/driver/file.php b/phpBB/phpbb/cache/driver/file.php index 2dc9f350c2..0a4f0ae31e 100644 --- a/phpBB/phpbb/cache/driver/file.php +++ b/phpBB/phpbb/cache/driver/file.php @@ -37,9 +37,9 @@ class file extends \phpbb\cache\driver\base $this->cache_dir = !is_null($cache_dir) ? $cache_dir : $phpbb_container->getParameter('core.cache_dir'); $this->filesystem = new \phpbb\filesystem\filesystem(); - if (!is_dir($this->cache_dir)) + if ($this->filesystem->is_writable(dirname($this->cache_dir)) && !is_dir($this->cache_dir)) { - @mkdir($this->cache_dir, 0777, true); + mkdir($this->cache_dir, 0777, true); } } diff --git a/phpBB/phpbb/filesystem/filesystem.php b/phpBB/phpbb/filesystem/filesystem.php index 6d34d990e2..39e95acc98 100644 --- a/phpBB/phpbb/filesystem/filesystem.php +++ b/phpBB/phpbb/filesystem/filesystem.php @@ -380,13 +380,13 @@ class filesystem implements filesystem_interface $file_gid = @filegroup($current_file); // Change owner - if ($file_uid !== $this->chmod_info['common_owner']) + if (is_writable($file) && $file_uid !== $this->chmod_info['common_owner']) { $this->chown($current_file, $this->chmod_info['common_owner'], $recursive); } // Change group - if ($file_gid !== $this->chmod_info['common_group']) + if (is_writable($file) && $file_gid !== $this->chmod_info['common_group']) { $this->chgrp($current_file, $this->chmod_info['common_group'], $recursive); } diff --git a/phpBB/phpbb/install/module/requirements/task/check_filesystem.php b/phpBB/phpbb/install/module/requirements/task/check_filesystem.php index cac0c541cf..f08b7b960d 100644 --- a/phpBB/phpbb/install/module/requirements/task/check_filesystem.php +++ b/phpBB/phpbb/install/module/requirements/task/check_filesystem.php @@ -217,6 +217,7 @@ class check_filesystem extends \phpbb\install\task_base catch (\phpbb\filesystem\exception\filesystem_exception $e) { // Do nothing + $this->response->add_warning_message($e->getMessage(), $e->get_filename()); } } @@ -232,6 +233,7 @@ class check_filesystem extends \phpbb\install\task_base } catch (\phpbb\filesystem\exception\filesystem_exception $e) { + $this->response->add_warning_message($e->getMessage(), $e->get_filename()); // Do nothing } }