aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-02-16 09:21:55 +0000
committerMario <mario@mariovavti.com>2021-02-16 09:21:55 +0000
commitefaadf54d3471da11a31fcc2bc1edf05730f1d2d (patch)
tree7409d00c63c91a2a76ab6f34e89575851f691dfc /include/items.php
parent6f71c6d9501ac740ceab4266d8b7ea1772dc5346 (diff)
downloadvolse-hubzilla-efaadf54d3471da11a31fcc2bc1edf05730f1d2d.tar.gz
volse-hubzilla-efaadf54d3471da11a31fcc2bc1edf05730f1d2d.tar.bz2
volse-hubzilla-efaadf54d3471da11a31fcc2bc1edf05730f1d2d.zip
make sure we do not try to update columns which do not exist
Diffstat (limited to 'include/items.php')
-rw-r--r--include/items.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/items.php b/include/items.php
index 223fba147..12b543697 100644
--- a/include/items.php
+++ b/include/items.php
@@ -2392,9 +2392,14 @@ function item_store_update($arr, $allow_exec = false, $deliver = true) {
logger('item_store_update: ' . print_r($arr,true), LOGGER_DATA);
- $str = '';
- foreach($arr as $k => $v) {
- if($str)
+ $columns = db_columns('item');
+ $str = '';
+ foreach ($arr as $k => $v) {
+ if (!in_array($k, $columns)) {
+ continue;
+ }
+
+ if ($str)
$str .= ",";
$str .= " " . TQUOT . $k . TQUOT . " = '" . $v . "' ";
}