Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2022-05-31 11:06:21 +0300
committerGitHub <noreply@github.com>2022-05-31 11:06:21 +0300
commitcf9660fdf055cbc12d7c06f641843f1c3754f797 (patch)
tree88e62ee655bff03c77682214e4a6206364fcc53d /lib
parentcf9d0b123a8947309febe932aa75b4036d69482f (diff)
parent3901a93c72ed7a008902a79fb5e0ee1de018f7bd (diff)
Merge pull request #32628 from nextcloud/bugfix/noid/json-throw
Use JSON_THROW_ON_ERROR instead of custom error handling
Diffstat (limited to 'lib')
-rw-r--r--lib/public/AppFramework/Http/JSONResponse.php8
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/public/AppFramework/Http/JSONResponse.php b/lib/public/AppFramework/Http/JSONResponse.php
index f4b936435c8..4870a64afd7 100644
--- a/lib/public/AppFramework/Http/JSONResponse.php
+++ b/lib/public/AppFramework/Http/JSONResponse.php
@@ -64,13 +64,7 @@ class JSONResponse extends Response {
* @throws \Exception If data could not get encoded
*/
public function render() {
- $response = json_encode($this->data, JSON_HEX_TAG);
- if ($response === false) {
- throw new \Exception(sprintf('Could not json_encode due to invalid ' .
- 'non UTF-8 characters in the array: %s', var_export($this->data, true)));
- }
-
- return $response;
+ return json_encode($this->data, JSON_HEX_TAG | JSON_THROW_ON_ERROR);
}
/**