﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
20221	`conditional_escape` does not work with lazy strings	Baptiste Mispelon	Baptiste Mispelon	"When passing the result of `ugettext_lazy` to `conditional_escape`, the result is not marked properly as safe which results in the data being escaped multiple times if `conditional_escape` is applied more than once.

{{{
#!python
>>> from django.utils.html import conditional_escape
>>> from django.utils.translation import ugettext_lazy
>>> 
>>> s = '<foo>'
>>> ss = ugettext_lazy(s)
>>> conditional_escape(conditional_escape(s))
'&lt;foo&gt;'
>>> str(conditional_escape(conditional_escape(ss)))
'&amp;lt;foo&amp;gt;'
}}}


I ran into this issue by accident when working on #20211 where some old code had been left in and was escaping some strings twice in some cases. In that case, it was easy to work around the bug by simply removing the redundant calls to `conditional_escape`."	Bug	closed	Utilities	dev	Normal	fixed			Ready for checkin	1	0	0	0	0	0
