From 1aebb2026212c65d42ba5d415232c7009193fd16 Mon Sep 17 00:00:00 2001 From: grandeljay Date: Wed, 20 Dec 2023 11:47:19 +0100 Subject: [PATCH 1/2] fix: session not restoring --- src/classes/wishthis/User.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/classes/wishthis/User.php b/src/classes/wishthis/User.php index d2d95a29..a5f9253f 100644 --- a/src/classes/wishthis/User.php +++ b/src/classes/wishthis/User.php @@ -689,5 +689,6 @@ class User } $this->__construct($user); + $this->stayLoggedIn = true; } } From 76f64cb7130d7b10d9089a05603e11daac4ac0ba Mon Sep 17 00:00:00 2001 From: grandeljay Date: Wed, 20 Dec 2023 11:57:15 +0100 Subject: [PATCH 2/2] fix: wish url being incomplete --- src/api/wishes.php | 4 +++- src/assets/js/parts/wish.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/api/wishes.php b/src/api/wishes.php index 709b5599..756db062 100644 --- a/src/api/wishes.php +++ b/src/api/wishes.php @@ -29,7 +29,9 @@ switch ($_SERVER['REQUEST_METHOD']) { } } elseif (isset($_GET['wish_url'])) { if (isset($_GET['isAffiliate'])) { - $response['isAffiliate'] = Wish::hasAffiliateLink($_GET['wish_url']); + $wishUrl = \base64_decode($_GET['wish_url']); + + $response['isAffiliate'] = Wish::hasAffiliateLink($wishUrl); } else { $url = trim($_GET['wish_url']); $cache = new Cache\Embed($url); diff --git a/src/assets/js/parts/wish.js b/src/assets/js/parts/wish.js index ab1d82f9..0da0790c 100644 --- a/src/assets/js/parts/wish.js +++ b/src/assets/js/parts/wish.js @@ -277,7 +277,7 @@ $(function () { input.attr('disabled', 'disabled'); - fetch('/index.php?page=api&module=wishes&wish_url=' + input.val() + '&isAffiliate', { + fetch('/index.php?page=api&module=wishes&wish_url=' + window.btoa(input.val()) + '&isAffiliate', { 'method' : 'GET', 'credentials' : 'include', })