Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed an edge-case for auto-escaping: if the stringfilter decorator i…

…s used and

generates a first argument that is a safe string, make the is_safe handling
work as expect.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6721 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit dc716112a746916b1ac9ffb092684acd8819572a 1 parent 2d0d662
@malcolmt malcolmt authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  django/template/defaultfilters.py
View
2  django/template/defaultfilters.py
@@ -25,6 +25,8 @@ def _dec(*args, **kwargs):
if args:
args = list(args)
args[0] = force_unicode(args[0])
+ if isinstance(args[0], SafeData) and getattr(func, 'is_safe', False):
+ return mark_safe(func(*args, **kwargs))
return func(*args, **kwargs)
# Include a reference to the real function (used to check original
Please sign in to comment.
Something went wrong with that request. Please try again.