Skip to content

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

Closed
danielbeardsley wants to merge 2 commits into
mootools:masterfrom
iFixit:uri-plus-decoding-fix
Closed

String.QueryString: fix bug decoding '+'#1313
danielbeardsley wants to merge 2 commits into
mootools:masterfrom
iFixit:uri-plus-decoding-fix

Conversation

@danielbeardsley
Copy link
Copy Markdown
Contributor

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.

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.replace only replaces the first occurrence when the search is specified
as a string.
@danielbeardsley
Copy link
Copy Markdown
Contributor Author

Thanks @sctice !

@SergioCrisostomo
Copy link
Copy Markdown
Member

LGTM 👍

@anutron
Copy link
Copy Markdown
Member

anutron commented Aug 10, 2015

👍

@SergioCrisostomo
Copy link
Copy Markdown
Member

added via 8abfa00

@Ezyschooling12
Copy link
Copy Markdown

List of all Top Schools in Hadapsar, Pune. Check the latest info about Admission Dates, Form, Fees Structure Eligibility Criteria etc.Offering a blend of academic excellence, innovative teaching methods, and a nurturing environment, these schools provide a well-rounded education for your child’s growth and success. Explore the best educational opportunities in Hadapsar today!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants