Skip to content

Commit

Permalink
NEXT-19835 - Update changelog
Browse files Browse the repository at this point in the history
NEXT-19835 - Added 'DEFAULT_ENCODING_OPTIONS' to JsonResponse
  • Loading branch information
SimonVorgers committed Feb 7, 2022
1 parent 5e62942 commit 9b82ec2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: Fix 'Malformed UTF-8 characters, possibly incorrectly encoded' Error
issue:
author: Alessandro Aussems
author_email: me@alessandroaussems.be
title: Fix 'Malformed UTF-8 characters, possibly incorrectly encoded' Error
issue: NEXT-19835
author: Alessandro Aussems
author_email: me@alessandroaussems.be
---
# Core
* Add `createResponse` in `src/Core/Framework/Api/Controller/SyncController.php` that adds the **JSON_INVALID_UTF8_SUBSTITUTE** encoding option to the response
2 changes: 1 addition & 1 deletion src/Core/Framework/Api/Controller/SyncController.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public function sync(Request $request, Context $context): JsonResponse
private function createResponse(SyncResult $result, int $statusCode = 200): JsonResponse
{
$response = new JsonResponse(null, $statusCode);
$response->setEncodingOptions(\JSON_INVALID_UTF8_SUBSTITUTE);
$response->setEncodingOptions(JsonResponse::DEFAULT_ENCODING_OPTIONS | \JSON_INVALID_UTF8_SUBSTITUTE);
$response->setData($result);

return $response;
Expand Down

0 comments on commit 9b82ec2

Please sign in to comment.