From 96b3a802ebce50be52886317645cfa7a943603f9 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Tue, 10 Jul 2018 17:01:57 +0200 Subject: Use a little bit less magic code to replace leading single-quote by json path prefix --- it_dbi.class | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/it_dbi.class b/it_dbi.class index 2b0e782..a6b7eee 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -269,7 +269,7 @@ function _set($tags, $allfields = false) } if ($dyns) - $result[] = "dyncols = IF(dyncols IS NULL, JSON_OBJECT(" . join(", ", (array)$dyns) . "), JSON_SET(dyncols, ". join(", ", it::map('"\'$." . substr($v, 1)', $dyns)) ."))"; + $result[] = "dyncols = IF(dyncols IS NULL, JSON_OBJECT(" . join(", ", (array)$dyns) . "), JSON_SET(dyncols, ". join(", ", it::replace(["^'" => "'$."], $dyns)) ."))"; return $result ? 'SET ' . implode(', ', $result) : ''; } -- cgit v1.2.3