Ticket #11268: django_contrib_admin_util_quote.diff

File django_contrib_admin_util_quote.diff, 948 bytes (added by mcsmart, 6 years ago)

Patch to trunk/django/contrib/admin/util.py for quote()

  • django/contrib/admin/util.py

     
    1010def quote(s):
    1111    """
    1212    Ensure that primary key values do not confuse the admin URLs by escaping
    13     any '/', '_' and ':' characters. Similar to urllib.quote, except that the
    14     quoting is slightly different so that it doesn't get automatically
     13    any ' ', '/', '_' and ':' characters. Similar to urllib.quote, except that
     14    the quoting is slightly different so that it doesn't get automatically
    1515    unquoted by the Web browser.
    1616    """
    1717    if not isinstance(s, basestring):
     
    1919    res = list(s)
    2020    for i in range(len(res)):
    2121        c = res[i]
    22         if c in """:/_#?;@&=+$,"<>%\\""":
     22        if c in ' :/_#?;@&=+$,"<>%\\':
    2323            res[i] = '_%02X' % ord(c)
    2424    return ''.join(res)
    2525
Back to Top