diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-11-28 21:51:17 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-11-28 21:51:17 +0000 |
| commit | a97abcffc27c5026041afccb1d76f7e4e4b1df69 (patch) | |
| tree | c6abc02b4d90e83788f6d156ca8efecb25cbae1c /django/template | |
| parent | 5d85a5147b55cbe7940df2321e73c48ca265f649 (diff) | |
queryset-refactor: Merged from trunk up to [6724].
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6726 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/template')
| -rw-r--r-- | django/template/__init__.py | 4 | ||||
| -rw-r--r-- | django/template/defaultfilters.py | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/django/template/__init__.py b/django/template/__init__.py index 761c08d6c9..c68a4b544d 100644 --- a/django/template/__init__.py +++ b/django/template/__init__.py @@ -547,9 +547,9 @@ class FilterExpression(object): if var == None: var, constant, i18n_constant = match.group("var", "constant", "i18n_constant") if i18n_constant: - var = '"%s"' % _(i18n_constant) + var = '"%s"' % _(i18n_constant.replace(r'\"', '"')) elif constant: - var = '"%s"' % constant + var = '"%s"' % constant.replace(r'\"', '"') upto = match.end() if var == None: raise TemplateSyntaxError, "Could not find variable at start of %s" % token diff --git a/django/template/defaultfilters.py b/django/template/defaultfilters.py index 7d4a72efb3..e62e2e3eaf 100644 --- a/django/template/defaultfilters.py +++ b/django/template/defaultfilters.py @@ -25,6 +25,8 @@ def stringfilter(func): 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 @@ -106,6 +108,7 @@ floatformat.is_safe = True def iriencode(value): """Escapes an IRI value for use in a URL.""" return force_unicode(iri_to_uri(value)) +iriencode.is_safe = True iriencode = stringfilter(iriencode) def linenumbers(value, autoescape=None): |
