diff --git a/system/Debug/Toolbar.php b/system/Debug/Toolbar.php index f67bffb2fbe9..e046ec4afa42 100644 --- a/system/Debug/Toolbar.php +++ b/system/Debug/Toolbar.php @@ -141,7 +141,7 @@ public function run($startTime, $totalTime, $request, $response): string foreach ($_SESSION as $key => $value) { // Replace the binary data with string to avoid json_encode failure. - if (preg_match('~[^\x20-\x7E\t\r\n]~', $value)) + if (is_string($value) && preg_match('~[^\x20-\x7E\t\r\n]~', $value)) { $value = 'binary data'; }