From ef2952b5fd44ace7e802c95a99289ff5a1791497 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 11 Jan 2024 17:00:47 +0100 Subject: libsync: dev branch compatibility --- Zotlabs/Lib/Libsync.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Zotlabs/Lib/Libsync.php b/Zotlabs/Lib/Libsync.php index 5f183192d..80c447672 100644 --- a/Zotlabs/Lib/Libsync.php +++ b/Zotlabs/Lib/Libsync.php @@ -339,6 +339,8 @@ class Libsync { } + $columns = db_columns('channel'); + $disallowed = [ 'channel_id', 'channel_account_id', 'channel_primary', 'channel_prvkey', 'channel_address', 'channel_notifyflags', 'channel_removed', 'channel_deleted', @@ -349,16 +351,16 @@ class Libsync { 'channel_a_delegate' ]; - $clean = []; foreach ($arr['channel'] as $k => $v) { - if (in_array($k, $disallowed)) + if (in_array($k, $disallowed)) { + continue; + } + + if (!in_array($k, $columns)) { continue; - $clean[$k] = $v; - } - if (count($clean)) { - foreach ($clean as $k => $v) { - dbq("UPDATE channel set " . dbesc($k) . " = '" . dbesc($v) . "' where channel_id = " . intval($channel['channel_id'])); } + + dbq("UPDATE channel set " . dbesc($k) . " = '" . dbesc($v) . "' where channel_id = " . intval($channel['channel_id'])); } } -- cgit v1.2.3