From b2899d76cf6ac9cae6a674e778e840ce09ceb9e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Fri, 20 Jul 2018 00:39:05 +0200 Subject: [PATCH] Small cleanup (#5416) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - added internal TODO to decide about is_result() usage - removed semicolon (not needed here) from SQL query - added empty line Signed-off-by: Roland Häder --- mod/profiles.php | 1 + src/Protocol/DFRN.php | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mod/profiles.php b/mod/profiles.php index 9c925924f7..3ceb8c6645 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -479,6 +479,7 @@ function profiles_post(App $a) { intval(local_user()) ); + /// @TODO decide to use dbm::is_result() here and check $r if ($r) { info(L10n::t('Profile updated.') . EOL); } diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 8cc148ff94..5326e49ac9 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -1978,7 +1978,7 @@ class DFRN * link an introduction to it. */ if (!DBM::is_result($r)) { - // database record did not get created. Quietly give up. + // Database record did not get created. Quietly give up. killme(); } @@ -2058,7 +2058,7 @@ class DFRN // update contact $r = q( - "SELECT `photo`, `url` FROM `contact` WHERE `id` = %d AND `uid` = %d;", + "SELECT `photo`, `url` FROM `contact` WHERE `id` = %d AND `uid` = %d", intval($importer["id"]), intval($importer["importer_uid"]) ); @@ -2332,6 +2332,7 @@ class DFRN if ($xt->type == ACTIVITY_OBJ_NOTE) { $item_tag = Item::selectFirst(['id', 'tag'], ['uri' => $xt->id, 'uid' => $importer["importer_uid"]]); + if (!DBM::is_result($item_tag)) { logger("Query failed to execute, no result returned in " . __FUNCTION__); return false;