Skip to content

Commit c087f1c

Browse files
committed
escaping html inside ansible-logs (fix #88)
1 parent 3005498 commit c087f1c

File tree

1 file changed

+3
-0
lines changed
  • src/ansibleguy-webui/aw/utils

1 file changed

+3
-0
lines changed

src/ansibleguy-webui/aw/utils/util.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from pkg_resources import get_distribution
1515
from crontab import CronTab
1616
from pytz import utc
17+
from django.utils.html import escape as escape_html
1718

1819
from aw.config.main import config
1920
from aw.config.hardcoded import SHORT_TIME_FORMAT
@@ -251,6 +252,8 @@ def ansible_log_text(line: str) -> str:
251252

252253

253254
def ansible_log_html(line: str) -> str:
255+
line = escape_html(line)
256+
254257
for color_code, color_html in ANSIBLE_LOG_COLOR_MAP.items():
255258
line = line.replace(color_code, color_html)
256259

0 commit comments

Comments
 (0)