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 /js | |
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 'js')
-rw-r--r-- | js/tracker.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/js/tracker.php b/js/tracker.php index 1cf637e188..ce9793b9cc 100644 --- a/js/tracker.php +++ b/js/tracker.php @@ -22,9 +22,19 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST' * * @see core/Piwik.php */ -define('PIWIK_INCLUDE_PATH', '..'); define('PIWIK_DOCUMENT_ROOT', '..'); -define('PIWIK_USER_PATH', '..'); + +if (file_exists(PIWIK_DOCUMENT_ROOT . '/bootstrap.php')) { + require_once PIWIK_DOCUMENT_ROOT . '/bootstrap.php'; +} + +if (!defined('PIWIK_INCLUDE_PATH')) { + define('PIWIK_INCLUDE_PATH', PIWIK_DOCUMENT_ROOT); +} + +if (!defined('PIWIK_USER_PATH')) { + define('PIWIK_USER_PATH', PIWIK_DOCUMENT_ROOT); +} require_once PIWIK_INCLUDE_PATH . '/libs/upgradephp/upgrade.php'; |