summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2006-09-23 08:41:09 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2006-09-23 08:41:09 +0000
commit670e8ab7040b3cb1f04d72a76b2c1fc9a4b3f457 (patch)
treef1f37e3bff55e76569e0798695f87ad4b69b8dfa /django
parent93597d051d9ef8bcdf0ff6b9859406b73ab4f52c (diff)
Fixed #2456 -- Added backslash escaping to addslashes, which is necessary once
you start escaping other things. Thanks, tom@eggdrop.ch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3799 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/template/defaultfilters.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/template/defaultfilters.py b/django/template/defaultfilters.py
index a2e9d2f405..cf1d3d5f6d 100644
--- a/django/template/defaultfilters.py
+++ b/django/template/defaultfilters.py
@@ -15,7 +15,7 @@ register = Library()
def addslashes(value):
"Adds slashes - useful for passing strings to JavaScript, for example."
- return value.replace('"', '\\"').replace("'", "\\'")
+ return value.replace('\\', '\\\\').replace('"', '\\"').replace("'", "\\'")
def capfirst(value):
"Capitalizes the first character of the value"