diff options
author | Michael Hamann <michael@content-space.de> | 2013-01-26 18:24:07 +0100 |
---|---|---|
committer | Michael Hamann <michael@content-space.de> | 2013-01-26 18:27:30 +0100 |
commit | 50f261f7d8fd4138fab3fca8c9b9eea290a3885b (patch) | |
tree | d384583d9b60b761de2ecf49ae918eb8b9d47758 | |
parent | c18b2212cfd6c8b085b8f82e0a43fe052c5fb57f (diff) | |
download | rpg-50f261f7d8fd4138fab3fca8c9b9eea290a3885b.tar.gz rpg-50f261f7d8fd4138fab3fca8c9b9eea290a3885b.tar.bz2 |
Fix set_doku_pref cookie date and value
-rw-r--r-- | inc/common.php | 5 |
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())); } } |