Skip to content

Commit

Permalink
Fixed Badly encoded JSON data warning when uploading files [#2663]
Browse files Browse the repository at this point in the history
  • Loading branch information
mahagr committed Sep 17, 2019
1 parent e30ab9a commit 5c9eb1c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

1. [](#bugfix)
* Fixed Flex user creation if file storage is being used [#2444](https://github.com/getgrav/grav/issues/2444)
* Fixed `Badly encoded JSON data` warning when uploading files [#2663](https://github.com/getgrav/grav/issues/2663)

# v1.6.15
## 08/20/2019
Expand Down
2 changes: 1 addition & 1 deletion system/src/Grav/Framework/Form/Traits/FormTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ protected function jsonDecode(array $data): array
foreach ($data as $key => &$value) {
if (\is_array($value)) {
$value = $this->jsonDecode($value);
} elseif ($value === '') {
} elseif (trim($value) === '') {
unset($data[$key]);
} else {
$value = json_decode($value, true);
Expand Down

0 comments on commit 5c9eb1c

Please sign in to comment.