Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #5734 -- Fixed an omission where we weren't passing the "safe" …

…argument

upstream in django.utils.http.urlquote(). Thanks, Thomas Güttler.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6554 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit bece0317724cc5ab436e493e62b99e7d4e3de5ec 1 parent 5ef7c4c
@malcolmt malcolmt authored
Showing with 6 additions and 1 deletion.
  1. +2 −1  django/utils/http.py
  2. +4 −0 tests/regressiontests/text/tests.py
View
3  django/utils/http.py
@@ -9,7 +9,8 @@ def urlquote(url, safe='/'):
can safely be used as part of an argument to a subsequent iri_to_uri() call
without double-quoting occurring.
"""
- return force_unicode(urllib.quote(smart_str(url)))
+ return force_unicode(urllib.quote(smart_str(url), safe))
+
urlquote = allow_lazy(urlquote, unicode)
def urlquote_plus(url, safe=''):
View
4 tests/regressiontests/text/tests.py
@@ -20,8 +20,12 @@
>>> from django.utils.http import urlquote, urlquote_plus
>>> urlquote(u'Paris & Orl\xe9ans')
u'Paris%20%26%20Orl%C3%A9ans'
+>>> urlquote(u'Paris & Orl\xe9ans', safe="&")
+u'Paris%20&%20Orl%C3%A9ans'
>>> urlquote_plus(u'Paris & Orl\xe9ans')
u'Paris+%26+Orl%C3%A9ans'
+>>> urlquote_plus(u'Paris & Orl\xe9ans', safe="&")
+u'Paris+&+Orl%C3%A9ans'
### iri_to_uri ###########################################################
>>> from django.utils.encoding import iri_to_uri

0 comments on commit bece031

Please sign in to comment.
Something went wrong with that request. Please try again.