Debug 메시지가 json_encode() 오류로 인해 잘못된 포맷으로 응답을 생성하는 문제 해결

This commit is contained in:
kkigomi 2024-01-20 23:24:30 +09:00
parent bb1699f577
commit 42919d1259
No known key found for this signature in database
GPG key ID: 99CF0633E78395B9

View file

@ -257,7 +257,11 @@ class DisplayHandler extends Handler
unset($_SESSION['_rx_debug_previous']);
if (preg_match('/^(.+)\}$/', $output, $matches))
{
$output = $matches[1] . ',"_rx_debug":' . json_encode($data) . '}';
$data = json_encode($data);
if (json_last_error() === JSON_ERROR_NONE)
{
$output = $matches[1] . ',"_rx_debug":' . $data . '}';
}
}
break;
default: