Open bladeoflight16 opened 7 years ago
Fixing this may be a breaking change, so it might make sense to make this some kind of setting or argument.
If safe is expected and you get "unsafe", to me, that's a bug. And probably, not a hard one to fix. Can't think of evil side-effects. @stewartpark what do you think?
I agree, @italomaia. I think this could be a potential problem and we should replicate whatever Flask's url_for does as much as possible :)
Flask's
url_for
function encodes input to be URL safe. For example,url_for('root', someparam='5 & 6 & more')
gives back/?someparam=5+%26+6+%26+more
.JSGlue doesn't escape the input at all.
Flask.url_for("root", {"someparam": "5 & 6 & more"})
gives back/?someparam=5 & 6 & more
.Here's a fully working demo script:
You'll see the results on the page.