Merge pull request #17440 from nextcloud/enh/noid/log-json-escape

Do not escape slashes in log json
This commit is contained in:
Roeland Jago Douma 2019-10-08 08:48:52 +02:00 committed by GitHub
commit f2d44b87bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -90,12 +90,12 @@ abstract class LogDetails {
// them manually. // them manually.
foreach($entry as $key => $value) { foreach($entry as $key => $value) {
if(is_string($value)) { if(is_string($value)) {
$testEncode = json_encode($value); $testEncode = json_encode($value, JSON_UNESCAPED_SLASHES);
if($testEncode === false) { if($testEncode === false) {
$entry[$key] = utf8_encode($value); $entry[$key] = utf8_encode($value);
} }
} }
} }
return json_encode($entry, JSON_PARTIAL_OUTPUT_ON_ERROR); return json_encode($entry, JSON_PARTIAL_OUTPUT_ON_ERROR | JSON_UNESCAPED_SLASHES);
} }
} }