Skip to content

Commit

Permalink
fix: htmlspecialchars first parameter can't be null
Browse files Browse the repository at this point in the history
  • Loading branch information
recca0120 committed Aug 19, 2022
1 parent 50417fb commit 63d562b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion resources/views/DatabasePanel/panel.php
Expand Up @@ -50,7 +50,7 @@
<table class="tracy-collapsed Laravel-DatabasePanel-explain">
<tr>
<?php foreach ($query['explains'][0] as $col => $value): ?>
<th><?php echo htmlspecialchars($col, ENT_NOQUOTES, 'UTF-8') ?></th>
<th><?php echo htmlspecialchars((string) $col, ENT_NOQUOTES, 'UTF-8') ?></th>
<?php endforeach ?>
</tr>
<?php foreach ($query['explains'] as $row): ?>
Expand Down
2 changes: 1 addition & 1 deletion src/Panels/Helper.php
Expand Up @@ -86,7 +86,7 @@ public static function highlight($sql, array $bindings = [], PDO $pdo = null)
return htmlspecialchars('\''.$binding->format('Y-m-d H:i:s').'\'', ENT_NOQUOTES, 'UTF-8');
}

return htmlspecialchars($binding, ENT_NOQUOTES, 'UTF-8');
return htmlspecialchars((string) $binding, ENT_NOQUOTES, 'UTF-8');
}, $bindings);
$sql = str_replace(['%', '?'], ['%%', '%s'], $sql);

Expand Down

0 comments on commit 63d562b

Please sign in to comment.