From 38c8ed4ca54f8f642e81574dc38757118ac7f085 Mon Sep 17 00:00:00 2001 From: grandeljay Date: Thu, 17 Aug 2023 10:50:59 +0200 Subject: [PATCH] fix: error when saving wish without priority --- src/api/wishes.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/api/wishes.php b/src/api/wishes.php index 5127ca50..304fde56 100644 --- a/src/api/wishes.php +++ b/src/api/wishes.php @@ -98,6 +98,10 @@ switch ($_SERVER['REQUEST_METHOD']) { $wish_priority = filter_input(INPUT_POST, 'wish_priority', FILTER_SANITIZE_NUMBER_INT); $wish_is_purchasable = isset($_POST['wish_is_purchasable']); + if ('' === $wish_priority) { + $wish_priority = null; + } + if (Wish::NO_IMAGE === $wish_image) { $wish_image = ''; }