New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String.QueryString: fix bug decoding '+' #1313

Closed
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
4 participants
@danielbeardsley
Contributor

danielbeardsley commented Jun 25, 2015

decodeURIComponent doesn't do the correct thing with query parameter
keys or values. Specifically, it leaves '+' as '+' when it should be
converting them to spaces as that's the specification. When browsers
submit HTML forms via GET, the values are encoded using
the 'application/x-www-form-urlencoded' mime type which converts
spaces to '+'. decodeURIComponent() will then give incorrect results
on components of the query string.

See: http://unixpapa.com/js/querystring.html for a description of the
problem.

String.QueryString: fix bug decoding '+'
decodeURIComponent doesn't do the correct thing with query parameter
keys or values. Specifically, it leaves '+' as '+' when it should be
converting them to spaces as that's the specification. When browsers
submit HTML forms via GET, the values are encoded using
the 'application/x-www-form-urlencoded' mime type which converts
spaces to '+'. decodeURIComponent() will then give incorrect results
on components of the query string.

See: http://unixpapa.com/js/querystring.html for a description of the
problem.

@SergioCrisostomo SergioCrisostomo added this to the 1.5.2 milestone Jun 25, 2015

String.QueryString: Replace multiple '+'
String.replace only replaces the first occurrence when the search is specified
as a string.
@danielbeardsley

This comment has been minimized.

Show comment
Hide comment
@danielbeardsley

danielbeardsley Jul 1, 2015

Contributor

Thanks @sctice !

Contributor

danielbeardsley commented Jul 1, 2015

Thanks @sctice !

@SergioCrisostomo

This comment has been minimized.

Show comment
Hide comment
@SergioCrisostomo

SergioCrisostomo Aug 10, 2015

Member

LGTM 👍

Member

SergioCrisostomo commented Aug 10, 2015

LGTM 👍

@anutron

This comment has been minimized.

Show comment
Hide comment
@anutron

anutron Aug 10, 2015

Member

👍

Member

anutron commented Aug 10, 2015

👍

@SergioCrisostomo

This comment has been minimized.

Show comment
Hide comment
@SergioCrisostomo
Member

SergioCrisostomo commented Aug 10, 2015

added via 8abfa00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment