From 804b759df1076bfec4d53a48b99cd3e81eff79f3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 24 Jun 2022 05:47:53 +0200 Subject: [PATCH] Changes: - let's get rid of that `Database::exists()` is being misused for checking table existence - reformatted array --- mod/item.php | 9 +++++++-- src/Database/Database.php | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mod/item.php b/mod/item.php index adfdc4cb03..2bfdf07a3b 100644 --- a/mod/item.php +++ b/mod/item.php @@ -439,8 +439,13 @@ function item_post(App $a) { // Ensure to only modify attachments that you own $srch = '<' . intval($contact_id) . '>'; - $condition = ['allow_cid' => $srch, 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '', - 'id' => $attach]; + $condition = [ + 'allow_cid' => $srch, + 'allow_gid' => '', + 'deny_cid' => '', + 'deny_gid' => '', + 'id' => $attach, + ]; if (!Attach::exists($condition)) { continue; } diff --git a/src/Database/Database.php b/src/Database/Database.php index 2c59607e9d..867cda33e5 100644 --- a/src/Database/Database.php +++ b/src/Database/Database.php @@ -825,6 +825,7 @@ class Database * * @return boolean Are there rows for that condition? * @throws \Exception + * @todo Get rid of the DBStructure::existsTable() invocation */ public function exists(string $table, array $condition): bool { -- 2.39.5