diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2019-09-17 23:35:22 +0300 |
---|---|---|
committer | diosmosis <diosmosis@users.noreply.github.com> | 2019-09-17 23:35:22 +0300 |
commit | 42b4ab13bc36511fabbf376e098e07ffae0d674a (patch) | |
tree | 1deef1ec16dca25b3a41cd200d5a481f7803e157 /core/Filechecks.php | |
parent | 583d8d1c28cf0b96810a81dfb7c76a3c1140d764 (diff) |
Fix user path was not working as it should (allow placing config file outside webroot) (#14866)
* Fix user path was not working as it should
* fix error
Diffstat (limited to 'core/Filechecks.php')
-rw-r--r-- | core/Filechecks.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/Filechecks.php b/core/Filechecks.php index da1990d31d..1447315bb1 100644 --- a/core/Filechecks.php +++ b/core/Filechecks.php @@ -23,7 +23,7 @@ class Filechecks if (!is_writable(PIWIK_INCLUDE_PATH . '/') || !is_writable(PIWIK_DOCUMENT_ROOT . '/index.php') || !is_writable(PIWIK_INCLUDE_PATH . '/core') || - !is_writable(PIWIK_USER_PATH . '/config/global.ini.php') + !is_writable(PIWIK_DOCUMENT_ROOT . '/config/global.ini.php') ) { return false; } @@ -40,7 +40,9 @@ class Filechecks { $resultCheck = array(); foreach ($directoriesToCheck as $directoryToCheck) { - if (!preg_match('/^' . preg_quote(PIWIK_USER_PATH, '/') . '/', $directoryToCheck)) { + if (!preg_match('/^' . preg_quote(PIWIK_USER_PATH, '/') . '/', $directoryToCheck) + && !preg_match('/^' . preg_quote(PIWIK_DOCUMENT_ROOT, '/') . '/', $directoryToCheck) + && !preg_match('/^' . preg_quote(PIWIK_INCLUDE_PATH, '/') . '/', $directoryToCheck)) { $directoryToCheck = PIWIK_USER_PATH . $directoryToCheck; } |