summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Application/TransactionsList/index.php26
1 files changed, 14 insertions, 12 deletions
diff --git a/Application/TransactionsList/index.php b/Application/TransactionsList/index.php
index 4bb56e0..64d2d2a 100644
--- a/Application/TransactionsList/index.php
+++ b/Application/TransactionsList/index.php
@@ -39,18 +39,20 @@ $list = array_reverse(array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/Private
$plist = [];
foreach ($list as $id) {
- $item = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/Private/Data/Transactions/" . $id), true);
-
- $item["author"] = [
- "id" => $item["author"],
- "name" => $users[$item["author"]] ?? $item["author"],
- "avatar" => "https://account.minteck.org/hub/api/rest/avatar/" . $item["author"] . "?dpr=2&size=48"
- ];
- $item["date"] = [
- "absolute" => $item["date"],
- "relative" => trim(timeAgo($item["date"]))
- ];
- $plist[] = $item;
+ if (trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/Private/Data/Transactions/" . $id)) !== "") {
+ $item = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/Private/Data/Transactions/" . $id), true);
+
+ $item["author"] = [
+ "id" => $item["author"],
+ "name" => $users[$item["author"]] ?? $item["author"],
+ "avatar" => "https://account.minteck.org/hub/api/rest/avatar/" . $item["author"] . "?dpr=2&size=48"
+ ];
+ $item["date"] = [
+ "absolute" => $item["date"],
+ "relative" => trim(timeAgo($item["date"]))
+ ];
+ $plist[] = $item;
+ }
}
die(json_encode($plist)); \ No newline at end of file