diff options
author | Minteck <contact@minteck.org> | 2022-06-17 20:14:46 +0200 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-06-17 20:14:46 +0200 |
commit | 2629b95c437cce1d331d8f4ab3a0d1ff394930a7 (patch) | |
tree | b401039f4ed05d864871ef43da34941f4e13f1f8 | |
parent | d67f6a0547700aded74e2429c4f13d6a9dbf29ce (diff) | |
download | bits-server-2629b95c437cce1d331d8f4ab3a0d1ff394930a7.tar.gz bits-server-2629b95c437cce1d331d8f4ab3a0d1ff394930a7.tar.bz2 bits-server-2629b95c437cce1d331d8f4ab3a0d1ff394930a7.zip |
Work around a bug
-rw-r--r-- | Application/TransactionsList/index.php | 26 |
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 |