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: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 2d0d662 commit dc716112a746916b1ac9ffb092684acd8819572a @malcolmt malcolmt committed Nov 28, 2007
Showing with 2 additions and 0 deletions.
  1. +2 −0 django/template/
@@ -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

0 comments on commit dc71611

Please sign in to comment.