From fce36b9d6e022ac86bde654500a4f690cca346ba Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Wed, 5 Jun 2024 14:51:13 +0530 Subject: [PATCH 1/2] Fixed: Cookie not updating in browser when url contains parenthesis --- classes/Cookie.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/classes/Cookie.php b/classes/Cookie.php index 0edb66672..312837ee1 100644 --- a/classes/Cookie.php +++ b/classes/Cookie.php @@ -89,8 +89,9 @@ class CookieCore $this->_path = '/'.$this->_path; } $this->_path = rawurlencode($this->_path); - $this->_path = str_replace('%2F', '/', $this->_path); - $this->_path = str_replace('%7E', '~', $this->_path); + $search = array('%2F', '%7E', '%28', '%29'); + $replace = array('/', '~', '(', ')'); + $this->_path = str_replace($search, $replace, $this->_path); $this->_domain = $this->getDomain($shared_urls); $this->_sameSite = Configuration::get('PS_COOKIE_SAMESITE'); $this->_name = 'QloApps-'.md5(($this->_standalone ? '' : _PS_VERSION_).$name.$this->_domain); From cc0fc2e9e0cca56af7297169f28ea1f5e5613d92 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Wed, 3 Jul 2024 17:45:09 +0530 Subject: [PATCH 2/2] added additional characted that are allowd in URL --- classes/Cookie.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/Cookie.php b/classes/Cookie.php index 312837ee1..90dbc9509 100644 --- a/classes/Cookie.php +++ b/classes/Cookie.php @@ -89,8 +89,8 @@ class CookieCore $this->_path = '/'.$this->_path; } $this->_path = rawurlencode($this->_path); - $search = array('%2F', '%7E', '%28', '%29'); - $replace = array('/', '~', '(', ')'); + $search = array('%2F', '%7E', '%28', '%29', '%2B', '%26'); + $replace = array('/', '~', '(', ')', '+', '&'); $this->_path = str_replace($search, $replace, $this->_path); $this->_domain = $this->getDomain($shared_urls); $this->_sameSite = Configuration::get('PS_COOKIE_SAMESITE');