Skip to content

Commit

Permalink
Merge pull request #1897 from atishamte/toolbar
Browse files Browse the repository at this point in the history
Toolbar fix w.r.t #1779
  • Loading branch information
lonnieezell authored Apr 1, 2019
2 parents b1820ed + a9cf036 commit 87d848c
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.
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 87d848c

Please sign in to comment.