Django

Code

Changeset 6721

Show
Ignore:
Timestamp:
11/28/07 14:03:28 (1 year ago)
Author:
mtredinnick
Message:

Fixed an edge-case for auto-escaping: if the stringfilter decorator is used and
generates a first argument that is a safe string, make the is_safe handling
work as expect.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/template/defaultfilters.py

    r6706 r6721  
    2626            args = list(args) 
    2727            args[0] = force_unicode(args[0]) 
     28        if isinstance(args[0], SafeData) and getattr(func, 'is_safe', False): 
     29            return mark_safe(func(*args, **kwargs)) 
    2830        return func(*args, **kwargs) 
    2931