Skip to content

Commit f5761a4

Browse files
authored
Prevent malformed UTF-8 characters in debug mode
To prevent UTF-8 error messages in debug mode when queries contain binary data, all texts in the queries part are processed with utf8_encode before adding in to the output.
1 parent 177b436 commit f5761a4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/QueryDataTable.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,13 @@ protected function globalSearch($keyword)
724724
*/
725725
protected function showDebugger(array $output)
726726
{
727-
$output['queries'] = $this->connection->getQueryLog();
727+
$query_log = $this->connection->getQueryLog();
728+
array_walk_recursive($query_log, function (&$item, $key)
729+
{
730+
$item = utf8_encode($item);
731+
});
732+
733+
$output['queries'] = $query_log;
728734
$output['input'] = $this->request->all();
729735

730736
return $output;

0 commit comments

Comments
 (0)