From 6baffd4f7c1d2885b7861a6e30503a76fb464963 Mon Sep 17 00:00:00 2001 From: Jay Trees Date: Fri, 4 Mar 2022 09:25:20 +0100 Subject: [PATCH] Fix wish view --- src/pages/wish.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/wish.php b/src/pages/wish.php index 0cbfcb87..80c1c1a7 100644 --- a/src/pages/wish.php +++ b/src/pages/wish.php @@ -8,6 +8,10 @@ use wishthis\{Page, Wish}; +$userIsAuthenticated = false; +$wish = new Wish($_GET['id'], false); +$wishlists = $user->getWishlists($wish->wishlist); + $page = new page(__FILE__, $wish->title); if ('POST' === $_SERVER['REQUEST_METHOD'] && count($_POST) >= 0) { @@ -21,10 +25,6 @@ if ('POST' === $_SERVER['REQUEST_METHOD'] && count($_POST) >= 0) { $page->messages[] = Page::success('Wish successfully updated.', 'Success'); } -$userIsAuthenticated = false; -$wish = new Wish($_GET['id'], false); -$wishlists = $user->getWishlists($wish->wishlist); - foreach ($wishlists as $wishlist) { if ($wish->wishlist === intval($wishlist['id'])) { $userIsAuthenticated = true;