From 790fa8c71d443d5da457005bcbbb917f3c0127bf Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 6 Nov 2017 16:24:30 +0100 Subject: [PATCH] allow sql fragments in Api\Storage\Base::delete as in other places --- api/src/Storage/Base.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/api/src/Storage/Base.php b/api/src/Storage/Base.php index 0d826c24e3..e929d262db 100644 --- a/api/src/Storage/Base.php +++ b/api/src/Storage/Base.php @@ -776,7 +776,11 @@ class Base $data = $keys; $keys = array(); foreach($this->db_cols as $db_col => $col) { - if (isset($data[$col])) + if (is_int($db_col)) + { + $keys[] = $col; + } + elseif (isset($data[$col])) { $keys[$db_col] = $col; } @@ -786,7 +790,14 @@ class Base foreach($keys as $db_col => $col) { - $query[$db_col] = $data[$col]; + if (is_int($db_col)) + { + $query[] = $col; + } + else + { + $query[$db_col] = $data[$col]; + } } if ($only_return_query) return $query;