Add 404 for wishlists

This commit is contained in:
Jay Trees 2022-01-18 15:25:14 +01:00
parent f16bf3358b
commit add4c0f829

View file

@ -17,7 +17,16 @@ $wishlist = $database->query('SELECT * FROM `wishlists`
WHERE `hash` = "' . $_GET['wishlist'] . '"')
->fetch();
$products = $user->getProducts($wishlist['id']);
if ($wishlist) {
$products = $user->getProducts($wishlist['id']);
} else {
http_response_code(404);
?>
<h1>Not found</h1>
<p>The requested Wishlist was not found and likely deleted by its creator.</p>
<?php
die();
}
?>
<main>