diff options
author | Mario Vavti <mario@mariovavti.com> | 2024-01-11 17:00:47 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2024-01-11 17:00:47 +0100 |
commit | ef2952b5fd44ace7e802c95a99289ff5a1791497 (patch) | |
tree | 4e8509402fe053a7f8f90b5c40c9709bbe5c80da /Zotlabs/Lib | |
parent | d655e1d7656a1b5aa444ca7fd6b4e2e8a067c8f7 (diff) | |
download | volse-hubzilla-ef2952b5fd44ace7e802c95a99289ff5a1791497.tar.gz volse-hubzilla-ef2952b5fd44ace7e802c95a99289ff5a1791497.tar.bz2 volse-hubzilla-ef2952b5fd44ace7e802c95a99289ff5a1791497.zip |
libsync: dev branch compatibility
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r-- | Zotlabs/Lib/Libsync.php | 16 |
1 files 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'])); } } |