summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--django/core/template/__init__.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/django/core/template/__init__.py b/django/core/template/__init__.py
index a501d6bbe8..c007e4bc80 100644
--- a/django/core/template/__init__.py
+++ b/django/core/template/__init__.py
@@ -301,6 +301,13 @@ class TokenParser:
else:
p = i
while i < len(subject) and subject[i] not in (' ', '\t'):
+ if subject[i] in ('"', "'"):
+ c = subject[i]
+ i += 1
+ while i < len(subject) and subject[i] != c:
+ i += 1
+ if i >= len(subject):
+ raise TemplateSyntaxError, "Searching for value. Unexpected end of string in column %d: %s" % subject
i += 1
s = subject[p:i]
while i < len(subject) and subject[i] in (' ', '\t'):