-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Encode URLs? #118
Comments
Awesome, thanks @DanielCoulbourne! |
@DanielCoulbourne I'm not sure what's wrong, but I'm not seeing the new |
Oh that makes sense... I'll fix that in a few. |
Can we encode the keys as well as the values? So if I have
it should become
|
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
I ran into a situation today where I was using user-generated input to generate URLs with Ziggy. For example:
However, if a user types in any character that has a special URL meaning (ie. an ampersand), then this URL is busted.
For example, if I search for "Jonathan&Amy", I'll get:
Since the ampersand is a query string separator, my
search
value will only be "Jonathan".A simple solution here would be to simply encode the URL when generating it using
encodeURIComponent()
. More info here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent.The text was updated successfully, but these errors were encountered: