Skip to content

Commit

Permalink
fix: undefined var if sort cookie is not set (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellite committed Mar 9, 2024
1 parent 9fd353f commit 288c106
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion endpoints/subscriptions/get.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand Down
2 changes: 1 addition & 1 deletion includes/version.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php
$version = "v1.15.0";
$version = "v1.15.1";
?>

0 comments on commit 288c106

Please sign in to comment.