Ticket #5945: safe_constants.diff

File safe_constants.diff, 941 bytes (added by SmileyChris, 8 years ago)
  • django/template/__init__.py

     
    594594            arg_vals = []
    595595            for lookup, arg in args:
    596596                if not lookup:
    597                     arg_vals.append(arg)
     597                    arg_vals.append(mark_safe(arg))
    598598                else:
    599599                    arg_vals.append(arg.resolve(context))
    600600            if getattr(func, 'needs_autoescape', False):
     
    701701            # If it's wrapped with quotes (single or double), then
    702702            # we're also dealing with a literal.
    703703            if var[0] in "\"'" and var[0] == var[-1]:
    704                 self.literal = var[1:-1]
     704                self.literal = mark_safe(var[1:-1])
    705705
    706706            else:
    707707                # Otherwise we'll set self.lookups so that resolve() knows we're
Back to Top