Skip to content

Commit 7876b05

Browse files
authored
Merge pull request #107 from LibreSign/fix/scope-json-decode-to-tablenode
fix: decode JSON strings only for TableNode payloads
2 parents 2b6e095 + 995e7ad commit 7876b05

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/NextcloudApiContext.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ public function sendRequest(string $verb, string $url, $body = null, array $head
196196
}
197197
if ($body instanceof TableNode) {
198198
$fd = $body->getRowsHash();
199-
$options['form_params'] = $this->decodeIfIsJsonString($fd);
199+
$options['form_params'] = $fd;
200+
$options['_decode_table_node_json'] = true;
200201
} elseif (is_array($body)) {
201202
$options['form_params'] = $body;
202203
}
@@ -488,8 +489,11 @@ public function setAppConfig(string $appId, TableNode $formData): void {
488489
protected function parseFormParams(array $options): array {
489490
if (!empty($options['form_params'])) {
490491
$this->parseTextRcursive($options['form_params']);
491-
$options['form_params'] = $this->decodeIfIsJsonString($options['form_params']);
492+
if (!empty($options['_decode_table_node_json'])) {
493+
$options['form_params'] = $this->decodeIfIsJsonString($options['form_params']);
494+
}
492495
}
496+
unset($options['_decode_table_node_json']);
493497
return $options;
494498
}
495499

0 commit comments

Comments
 (0)