Skip to content

Commit 83b312e

Browse files
g2probhudson
authored andcommitted
Escape invalid html in SQL queries.
For example, a query containing a stray ampersand needs to be escaped. Signed-off-by: Rob Hudson <[email protected]>
1 parent e25a6ba commit 83b312e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

debug_toolbar/panels/sql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def process(self, stack, stream):
197197
is_keyword = token_type in sqlparse.tokens.Keyword
198198
if is_keyword:
199199
yield sqlparse.tokens.Text, '<strong>'
200-
yield token_type, value
200+
yield token_type, django.utils.html.escape(value)
201201
if is_keyword:
202202
yield sqlparse.tokens.Text, '</strong>'
203203

0 commit comments

Comments
 (0)