summaryrefslogtreecommitdiff
path: root/inc/common.php
diff options
context:
space:
mode:
authorMichael Hamann <michael@content-space.de>2013-01-26 18:24:07 +0100
committerMichael Hamann <michael@content-space.de>2013-01-26 18:27:30 +0100
commit50f261f7d8fd4138fab3fca8c9b9eea290a3885b (patch)
treed384583d9b60b761de2ecf49ae918eb8b9d47758 /inc/common.php
parentc18b2212cfd6c8b085b8f82e0a43fe052c5fb57f (diff)
downloadrpg-50f261f7d8fd4138fab3fca8c9b9eea290a3885b.tar.gz
rpg-50f261f7d8fd4138fab3fca8c9b9eea290a3885b.tar.bz2
Fix set_doku_pref cookie date and value
Diffstat (limited to 'inc/common.php')
-rw-r--r--inc/common.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/inc/common.php b/inc/common.php
index e436ec263..88e60f02c 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -1574,15 +1574,16 @@ function set_doku_pref($pref, $val) {
for($i = 0; $i < $cnt; $i += 2) {
if($parts[$i] == $pref) {
$parts[$i + 1] = urlencode($val);
+ break;
}
}
$cookieVal = implode('#', $parts);
} else if (!$orig) {
- $cookieVal = $_COOKIE['DOKU_PREFS'].'#'.urlencode($pref).'#'.urlencode($val);
+ $cookieVal = ($_COOKIE['DOKU_PREFS'] ? $_COOKIE['DOKU_PREFS'].'#' : '').urlencode($pref).'#'.urlencode($val);
}
if (!empty($cookieVal)) {
- setcookie('DOKU_PREFS', $cookieVal, strtotime('+1 year'), DOKU_BASE, '', ($conf['securecookie'] && is_ssl()));
+ setcookie('DOKU_PREFS', $cookieVal, time()+365*24*3600, DOKU_BASE, '', ($conf['securecookie'] && is_ssl()));
}
}