aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Lib/Libsync.php16
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']));
}
}