fix: wish url being incomplete

This commit is contained in:
grandeljay 2023-12-20 11:57:15 +01:00
parent 1aebb20262
commit 76f64cb713
2 changed files with 4 additions and 2 deletions

View file

@ -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);

View file

@ -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',
})