From 6fb4f6e2996cf442b614a073f30839419d9db030 Mon Sep 17 00:00:00 2001 From: Luke Plant Date: Mon, 13 Sep 2010 23:01:34 +0000 Subject: Fixed #13765 - 'safe' parameter for urlencode filter Thanks to KyleMac for the suggestion and SmileyChris for the patch git-svn-id: http://code.djangoproject.com/svn/django/trunk@13849 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/ref/templates/builtins.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'docs') diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt index 4f33bd212c..85c0b6dc26 100644 --- a/docs/ref/templates/builtins.txt +++ b/docs/ref/templates/builtins.txt @@ -1967,6 +1967,19 @@ For example:: If ``value`` is ``"http://www.example.org/foo?a=b&c=d"``, the output will be ``"http%3A//www.example.org/foo%3Fa%3Db%26c%3Dd"``. +.. versionadded:: 1.1 + +An optional argument containing the characters which should not be escaped can +be provided. + +If not provided, the '/' character is assumed safe. An empty string can be +provided when *all* characters should be escaped. For example:: + + {{ value|urlencode:"" }} + +If ``value`` is ``"http://www.example.org/"``, the output will be +``"http%3A%2F%2Fwww.example.org%2F"``. + .. templatefilter:: urlize urlize -- cgit v1.3