From 4f2329be85c03554c42fc32b10cdb0e2b450a1d1 Mon Sep 17 00:00:00 2001 From: croxton Date: Thu, 2 Feb 2017 18:09:59 +0000 Subject: [PATCH] Beef up cookie tampering prevention. Added '); } if ($output) @@ -1065,7 +1065,7 @@ public function get($params='', $type='variable', $scope='user') $value = $this->set(); } - ee()->TMPL->log_item('Stash: RETRIEVED '. $name . ' with value ' . $value); + ee()->TMPL->log_item('Stash: RETRIEVED '. $name . ' with value: '); // save to bundle if ($bundle !== NULL) @@ -5100,7 +5100,7 @@ private function _get_boolean_config_item($item, $default = TRUE) */ private function _set_stash_cookie($unique_id) { - $cookie_data = serialize(array( + $cookie_data = json_encode(array( 'id' => $unique_id, 'dt' => ee()->localize->now )); @@ -5123,7 +5123,7 @@ private function _set_stash_cookie($unique_id) */ private function _get_stash_cookie() { - $cookie_data = @unserialize(ee()->input->cookie($this->stash_cookie)); + $cookie_data = @json_decode(ee()->input->cookie($this->stash_cookie), TRUE); if ($cookie_data !== FALSE) {