Ticket #1862: tg-1.0-url_encoding.patch
| File tg-1.0-url_encoding.patch, 0.8 kB (added by wmark, 7 months ago) |
|---|
-
turbogears/controllers.py
old new 528 528 tgparams.update(kw) 529 529 except AttributeError: 530 530 raise TypeError('url() expects a dictionary for query parameters') 531 args = []531 args = dict() 532 532 for key, value in tgparams.iteritems(): 533 533 if value is None: 534 534 continue … … 541 541 continue 542 542 if isinstance(v, unicode): 543 543 v = v.encode("utf8") 544 args .append("%s=%s" % (k, urllib.quote(str(v))))544 args[k] = v 545 545 if args: 546 result += "?" + "&".join(args)546 result += (('?' in result) and '&' or '?') + urllib.urlencode(args, True) 547 547 return result 548 548 549 549 def check_app_root():