From d07968ffc9e4616cf83957e97f8718577578cafa Mon Sep 17 00:00:00 2001 From: Miguel Ribeiro Date: Sat, 9 Mar 2024 22:32:18 +0100 Subject: [PATCH] fix: undefined var if sort cookie is not set --- endpoints/subscriptions/get.php | 2 +- includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/endpoints/subscriptions/get.php b/endpoints/subscriptions/get.php index 3ddddd669..1a0befb0f 100644 --- a/endpoints/subscriptions/get.php +++ b/endpoints/subscriptions/get.php @@ -16,11 +16,11 @@ if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] === true) { $sort = "next_payment"; + $order = "ASC"; $sql = "SELECT * FROM subscriptions ORDER BY next_payment ASC, inactive ASC"; if (isset($_COOKIE['sortOrder']) && $_COOKIE['sortOrder'] != "") { $sort = $_COOKIE['sortOrder']; $allowedSortCriteria = ['name', 'id', 'next_payment', 'price', 'payer_user_id', 'category_id', 'payment_method_id']; - $order = "ASC"; if ($sort == "price" || $sort == "id") { $order = "DESC"; } diff --git a/includes/version.php b/includes/version.php index c6632051b..6ba1ff4b1 100644 --- a/includes/version.php +++ b/includes/version.php @@ -1,3 +1,3 @@ \ No newline at end of file