Skip to content

Wallos: Open-source, self-hostable personal subscription tracker. Visualize your recurring expenses, manage your budget, and save money.

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

Miguel Ribeiro288c10624592
diff --git a/endpoints/subscriptions/get.php b/endpoints/subscriptions/get.php
index 3ddddd6..1a0befb 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 c663205..6ba1ff4 100644
--- a/includes/version.php
+++ b/includes/version.php
@@ -1,3 +1,3 @@
<?php
- $version = "v1.15.0";
+ $version = "v1.15.1";
?>
\ No newline at end of file