&time replaced by × in url

49 views
Skip to first unread message

Gael Princivalle

unread,
Sep 19, 2016, 9:31:17 AM9/19/16
to web2py-users
Hello.

When I build this URL:
url = URL('/maps/api/timezone/json', scheme='https', host='maps.googleapis.com', vars=dict(key='mykey', location=str(events_latitude) + ',' + str(events_longitude), timestamp=str(today_UTC_timestamp)))

"&times" is replaced by "×":


For location & is ok.

I've tried also to concatenate strings, using ascii with chr(38), the result is the same.

Someones have a solution?

Thanks.

Niphlod

unread,
Sep 19, 2016, 10:12:35 AM9/19/16
to web2py-users
what version are you using ? can you try starting a shell and doing this ?

>>> URL(vars=dict(loc='foo', timestamp='bar'))


my output is 
'/welcome/default/index?loc=foo&timestamp=bar'

Anthony

unread,
Sep 19, 2016, 10:35:57 AM9/19/16
to web2py-users
Where/how are you using the resulting url variable. It looks like you are displaying it (unescaped) directly as HTML, in which case, "&times" is treated as the HTML entity name for the multiplication sign. It should work if you just let web2py escape it, though we may need to see more code.


Anthony

Gael Princivalle

unread,
Sep 19, 2016, 10:50:53 AM9/19/16
to web2py-users
Thank you all.

Yes Anthony I was testing the url returning it from a function and displaying it directly from the function url in the browser.
URL is correct, sorry for that.
Reply all
Reply to author
Forward
0 new messages