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

Web searches aren’t always properly escaped #313

Closed
skurfer opened this issue May 12, 2011 · 2 comments
Closed

Web searches aren’t always properly escaped #313

skurfer opened this issue May 12, 2011 · 2 comments
Labels

Comments

@skurfer
Copy link
Member

skurfer commented May 12, 2011

For example, search for

"Bob Marley & the Wailers”

The ampersand is sent through unencoded. This should be handled by line 48 of QSWebSearchController.m in the web search plug-in. Maybe it’s not understanding the encoding?

@pjrobertson
Copy link
Member

Good spot. I'll fix this when I do the rest of the web search fixes.

The URLEncoding method has legalURLCharactersToBeEscaped set to NULL. This should be kept that way. & is a legal URL character, and we don't want to encode if for real URLs (the URLEncoding method is used everywhere QS deals with URLs)

The correct behaviour is to encode '&' only for the search term, which should be done in QSWebController, or using CF's CFURLCreateStringByAddingPercentEscapes. Probably better to use CF's method to cover things like /, $, :, =, # that could all be in the search term and should be escaped. E.g. using a search such as http://hs.facebook.com/s.php?q=***&n=-1 you could search for name&anotherKey=something and Facebook's s.php would process try and process that

http://cybersam.com/programming/proper-url-percent-encoding-in-ios

@skurfer
Copy link
Member Author

skurfer commented Jun 1, 2011

This is fixed in the latest Web Search module.

@skurfer skurfer closed this as completed Jun 1, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants