summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube/rcube_config.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2015-02-03 07:52:14 -0500
committerAleksander Machniak <alec@alec.pl>2015-02-03 07:52:14 -0500
commite17decc4c2b175e1b2e3cd79f7c8b4c39c1f70f1 (patch)
tree42b25f6c255668b662f8e5a06c7444ae3c592ea8 /program/lib/Roundcube/rcube_config.php
parente8fc8d303a30658abd70419917a1373131802e28 (diff)
Better handle log/temp directory misconfiguration
Diffstat (limited to 'program/lib/Roundcube/rcube_config.php')
-rw-r--r--program/lib/Roundcube/rcube_config.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/program/lib/Roundcube/rcube_config.php b/program/lib/Roundcube/rcube_config.php
index 3fae931d7..89e45449d 100644
--- a/program/lib/Roundcube/rcube_config.php
+++ b/program/lib/Roundcube/rcube_config.php
@@ -233,8 +233,14 @@ class rcube_config
$this->prop['skin'] = self::DEFAULT_SKIN;
// fix paths
- $this->prop['log_dir'] = $this->prop['log_dir'] ? realpath(unslashify($this->prop['log_dir'])) : RCUBE_INSTALL_PATH . 'logs';
- $this->prop['temp_dir'] = $this->prop['temp_dir'] ? realpath(unslashify($this->prop['temp_dir'])) : RCUBE_INSTALL_PATH . 'temp';
+ foreach (array('log_dir' => 'logs', 'temp_dir' => 'temp') as $key => $dir) {
+ foreach (array($this->prop[$key], '../' . $this->prop[$key], RCUBE_INSTALL_PATH . $dir) as $path) {
+ if ($path && ($realpath = realpath(unslashify($path)))) {
+ $this->prop[$key] = $realpath;
+ break;
+ }
+ }
+ }
// fix default imap folders encoding
foreach (array('drafts_mbox', 'junk_mbox', 'sent_mbox', 'trash_mbox') as $folder) {