Skip to content

Commit

Permalink
Fix highlighting in database debug toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
vlakoff committed Sep 25, 2021
1 parent c05f5a6 commit 1e333e6
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions system/Database/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,23 +372,23 @@ public function debugToolbarDisplay(): string
'FROM',
'WHERE',
'AND',
'LEFT JOIN',
'RIGHT JOIN',
'LEFT JOIN',
'RIGHT JOIN',
'JOIN',
'ORDER BY',
'GROUP BY',
'ORDER BY',
'GROUP BY',
'LIMIT',
'INSERT',
'INTO',
'VALUES',
'UPDATE',
'OR ',
'OR ',
'HAVING',
'OFFSET',
'NOT IN',
'NOT IN',
'IN',
'LIKE',
'NOT LIKE',
'NOT LIKE',
'COUNT',
'MAX',
'MIN',
Expand All @@ -407,7 +407,9 @@ public function debugToolbarDisplay(): string
$sql = $this->finalQueryString;

foreach ($highlight as $term) {
$sql = str_replace($term, '<strong>' . $term . '</strong>', $sql);
$from = $term;
$to = '<strong>' . str_replace(' ', '&nbsp;', $term) . '</strong>';
$sql = str_replace($from, $to, $sql);
}

return $sql;
Expand Down

0 comments on commit 1e333e6

Please sign in to comment.