Wallos: Open-source, self-hostable personal subscription tracker. Visualize your recurring expenses, manage your budget, and save money.
fix: unset sortOrder var
Miguel Ribeiroa1fab4dd1067
diff --git a/endpoints/cronjobs/sendnotifications.php b/endpoints/cronjobs/sendnotifications.phpindex 8b9153f..1298b39 100644--- a/endpoints/cronjobs/sendnotifications.php+++ b/endpoints/cronjobs/sendnotifications.php@@ -9,6 +9,9 @@ require __DIR__ . '/../../libs/PHPMailer/PHPMailer.php';require __DIR__ . '/../../libs/PHPMailer/SMTP.php';require __DIR__ . '/../../libs/PHPMailer/Exception.php';+$date = new DateTime('now');+echo "\n" . $date->format('Y-m-d') . " " . $date->format('H:i:s') . "<br />\n";+// Get all user ids$query = "SELECT id, username FROM user";$stmt = $db->prepare($query);@@ -16,7 +19,7 @@ $usersToNotify = $stmt->execute();while ($userToNotify = $usersToNotify->fetchArray(SQLITE3_ASSOC)) {$userId = $userToNotify['id'];- echo "For user: " . $userToNotify['username'] . "<br />";+ echo "\nFor user: " . $userToNotify['username'] . "<br />";$days = 1;$emailNotificationsEnabled = false;diff --git a/endpoints/subscriptions/get.php b/endpoints/subscriptions/get.phpindex 141335e..98fd9a2 100644--- a/endpoints/subscriptions/get.php+++ b/endpoints/subscriptions/get.php@@ -20,6 +20,7 @@ if (isset($settings['color_theme'])) {if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] === true) {$sort = "next_payment";+ $sortOrder = $sort;$order = "ASC";$sql = "SELECT * FROM subscriptions ORDER BY next_payment ASC, inactive ASC";if (isset($_COOKIE['sortOrder']) && $_COOKIE['sortOrder'] != "") {diff --git a/includes/version.php b/includes/version.phpindex 9c7e859..70d9561 100644--- a/includes/version.php+++ b/includes/version.php@@ -1,3 +1,3 @@<?php-$version = "v2.19.0";+$version = "v2.19.1";?>\ No newline at end of filediff --git a/index.php b/index.phpindex f3fb68d..a3b966d 100644--- a/index.php+++ b/index.php@@ -5,6 +5,7 @@ require_once 'includes/getdbkeys.php';include_once 'includes/list_subscriptions.php';$sort = "next_payment";+$sortOrder = $sort;$sql = "SELECT * FROM subscriptions WHERE user_id = :userId ORDER BY next_payment ASC, inactive ASC";if (isset($_COOKIE['sortOrder']) && $_COOKIE['sortOrder'] != "") {$sort = $_COOKIE['sortOrder'];@@ -22,7 +23,7 @@ if (isset($_COOKIE['sortOrder']) && $_COOKIE['sortOrder'] != "") {}$sql = "SELECT * FROM subscriptions WHERE user_id = :userId";- $sql .= " ORDER BY LOWER($sort) $order";+ $sql .= " ORDER BY $sort $order";if ($sort != "next_payment") {$sql .= ", next_payment ASC";}