]> git.mxchange.org Git - friendica.git/commitdiff
Changes:
authorRoland Häder <roland@mxchange.org>
Fri, 24 Jun 2022 03:47:53 +0000 (05:47 +0200)
committerRoland Häder <roland@mxchange.org>
Sat, 25 Jun 2022 14:48:37 +0000 (16:48 +0200)
- let's get rid of that `Database::exists()` is being misused for checking table existence
- reformatted array

mod/item.php
src/Database/Database.php

index adfdc4cb0375812fe4346b2a135c36097c8c4b28..2bfdf07a3b36a852ca1314af5a3d2c0c72e87ef4 100644 (file)
@@ -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;
                                }
index 2c59607e9df73f940fd18f4dfb9d71fd6c6232f7..867cda33e56e127552be5a1bc0c6cf175250d1ca 100644 (file)
@@ -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
        {