X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/05e47fbb28eb0f3f7803b6bfe194896b6e6c1ed0..b6df4865251eb11db4bd4b0b1f35ae8455440be9:/nominatim/api/logging.py
diff --git a/nominatim/api/logging.py b/nominatim/api/logging.py
index e16e0bd2..2d9a487a 100644
--- a/nominatim/api/logging.py
+++ b/nominatim/api/logging.py
@@ -13,6 +13,7 @@ import datetime as dt
import textwrap
import io
import re
+import html
import sqlalchemy as sa
from sqlalchemy.ext.asyncio import AsyncConnection
@@ -227,7 +228,7 @@ class HTMLLogger(BaseLogger):
HtmlFormatter(nowrap=True, lineseparator='
'))
self._write(f'
{sqlstr}
{sqlstr}
')
+ self._write(f'{html.escape(sqlstr)}
')
def _python_var(self, var: Any) -> str:
@@ -235,7 +236,7 @@ class HTMLLogger(BaseLogger):
fmt = highlight(str(var), PythonLexer(), HtmlFormatter(nowrap=True))
return f'{fmt}
{str(var)}
'
+ return f'{html.escape(str(var))}
'
def _write(self, text: str) -> None: