Skip to content

Commit

Permalink
fix: $_SESSION may be undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Dec 17, 2023
1 parent eea4574 commit 392beac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion system/Debug/Toolbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function run(float $startTime, float $totalTime, RequestInterface $reques
$data['vars']['varData'][esc($heading)] = $varData;
}

if ($_SESSION !== []) {
if (isset($_SESSION)) {
foreach ($_SESSION as $key => $value) {
// Replace the binary data with string to avoid json_encode failure.
if (is_string($value) && preg_match('~[^\x20-\x7E\t\r\n]~', $value)) {
Expand Down

0 comments on commit 392beac

Please sign in to comment.