From 995e7ad1129ee56bc41770eef053796dec24c902 Mon Sep 17 00:00:00 2001 From: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> Date: Mon, 16 Feb 2026 18:49:44 -0300 Subject: [PATCH] fix: decode JSON strings only for TableNode payloads Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> --- src/NextcloudApiContext.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/NextcloudApiContext.php b/src/NextcloudApiContext.php index 379b4e4..90f495c 100644 --- a/src/NextcloudApiContext.php +++ b/src/NextcloudApiContext.php @@ -196,7 +196,8 @@ public function sendRequest(string $verb, string $url, $body = null, array $head } if ($body instanceof TableNode) { $fd = $body->getRowsHash(); - $options['form_params'] = $this->decodeIfIsJsonString($fd); + $options['form_params'] = $fd; + $options['_decode_table_node_json'] = true; } elseif (is_array($body)) { $options['form_params'] = $body; } @@ -488,8 +489,11 @@ public function setAppConfig(string $appId, TableNode $formData): void { protected function parseFormParams(array $options): array { if (!empty($options['form_params'])) { $this->parseTextRcursive($options['form_params']); - $options['form_params'] = $this->decodeIfIsJsonString($options['form_params']); + if (!empty($options['_decode_table_node_json'])) { + $options['form_params'] = $this->decodeIfIsJsonString($options['form_params']); + } } + unset($options['_decode_table_node_json']); return $options; }