fix: undefined var if sort cookie is not set (#207)

This commit is contained in:
Miguel Ribeiro 2024-03-09 22:33:29 +01:00 committed by GitHub
parent 9fd353fc3f
commit 288c106245
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -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";
}

View File

@ -1,3 +1,3 @@
<?php
$version = "v1.15.0";
$version = "v1.15.1";
?>