Skip to content
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

Avoid double-encoding query #23

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

lime
Copy link

@lime lime commented Feb 2, 2021

Summary

Queries that use non-URL-safe characters currently get double-encoded, causing MediaWiki not to return any matching results.

Other Information

Hash#to_query already URL-encodes the values. Calling CGI::escape on top of that causes reserved characters and non-ASCII characters to be double-encoded.

E.g.

> {foo: "ê!"}.to_query
=> "foo=%C3%AA%21"

> {foo: CGI::escape("ê!")}.to_query
=> "foo=%25C3%25AA%2521"

I suspected this was the case in #17 (comment), but I didn't investigate it properly until now.

Copyright assignment

I agree to the Contributor's Agreement and assign all rights, including copyright, to these Contributions to Security Roots.

Calling Hash#to_query already URL-encodes the values, causing reserved
characters and non-ASCII characters to be double-encoded and the query
to not return any results.
Base automatically changed from master to main February 16, 2021 13:20
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.

1 participant