Skip to content

Commit

Permalink
Toolbar fix w.r.t #1779
Browse files Browse the repository at this point in the history
  • Loading branch information
atishhamte committed Mar 29, 2019
1 parent 6d2aaae commit a9cf036
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions system/Debug/Toolbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ public function run($startTime, $totalTime, $request, $response): string
{
foreach ($_SESSION as $key => $value)
{
// Replace the binary data with string to avoid json_encode failure.

This comment has been minimized.

Copy link
@daif

daif Apr 2, 2019

Contributor

$value is not always string, is_string($value) && preg_match('~[^\x20-\x7E\t\r\n]~', $value)

if (preg_match('~[^\x20-\x7E\t\r\n]~', $value))
{
$value = 'binary data';
}

$data['vars']['session'][esc($key)] = is_string($value) ? esc($value) : print_r($value, true);
}
}
Expand Down

0 comments on commit a9cf036

Please sign in to comment.