Do not escape slashes in log json

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2019-10-07 13:39:40 +02:00
parent 049628a3f5
commit 29a6f2d830
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
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);
} }
} }