mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
[1.7.x] Fixed an inconsistency introduced in 547b1810.
mark_safe and mark_for_escaping should have been kept similar.
On Python 2 this change has no effect. On Python 3 it fixes the use case
shown in the regression test for mark_for_escaping, which used to raise
a TypeError. The regression test for mark_safe is just for completeness.
Backport of 5c5eb5fe from master.
This commit is contained in:
@@ -144,4 +144,4 @@ def mark_for_escaping(s):
|
||||
return EscapeBytes(s)
|
||||
if isinstance(s, (six.text_type, Promise)):
|
||||
return EscapeText(s)
|
||||
return EscapeBytes(bytes(s))
|
||||
return EscapeString(str(s))
|
||||
|
||||
Reference in New Issue
Block a user