aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/di
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2016-12-09 11:10:28 +0100
committerMarc Alexander <admin@m-a-styles.de>2016-12-09 11:10:28 +0100
commit6a568719d031544553a9e236e4128c5bfbd42600 (patch)
tree175929f71c346d4e25d7fc4d8a2ba4c2d5e42d64 /phpBB/phpbb/di
parent5f56e9025b276419578507ddbab933183649b47d (diff)
downloadforums-6a568719d031544553a9e236e4128c5bfbd42600.tar
forums-6a568719d031544553a9e236e4128c5bfbd42600.tar.gz
forums-6a568719d031544553a9e236e4128c5bfbd42600.tar.bz2
forums-6a568719d031544553a9e236e4128c5bfbd42600.tar.xz
forums-6a568719d031544553a9e236e4128c5bfbd42600.zip
[ticket/14891] Use filesystem classes for checking on tmp dir
The cache dir will now also only be used if tmp dir does not exist or if it's not writable. PHPBB3-14891
Diffstat (limited to 'phpBB/phpbb/di')
-rw-r--r--phpBB/phpbb/di/proxy_instantiator.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/phpBB/phpbb/di/proxy_instantiator.php b/phpBB/phpbb/di/proxy_instantiator.php
index 1f51100493..47cc7b69c4 100644
--- a/phpBB/phpbb/di/proxy_instantiator.php
+++ b/phpBB/phpbb/di/proxy_instantiator.php
@@ -13,7 +13,8 @@
namespace phpbb\di;
-use \bantu\IniGetWrapper\IniGetWrapper;
+use bantu\IniGetWrapper\IniGetWrapper;
+use phpbb\filesystem\filesystem;
use ProxyManager\Configuration;
use ProxyManager\Factory\LazyLoadingValueHolderFactory;
use ProxyManager\GeneratorStrategy\EvaluatingGeneratorStrategy;
@@ -45,7 +46,10 @@ class proxy_instantiator implements InstantiatorInterface
// Prevent trying to write to system temp dir in case of open_basedir
// restrictions being in effect
$ini_wrapper = new IniGetWrapper();
- if ($ini_wrapper->getString('open_basedir') || !file_exists(sys_get_temp_dir()))
+ $filesystem = new filesystem();
+ $tmp_dir = sys_get_temp_dir();
+ if ($ini_wrapper->getString('open_basedir') &&
+ (!$filesystem->exists($tmp_dir) || !$filesystem->is_writable($tmp_dir)))
{
$config->setProxiesTargetDir($cache_dir);
}