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

Incorrectly escaping URL's #3

Open
lprhodes opened this issue Aug 24, 2014 · 3 comments
Open

Incorrectly escaping URL's #3

lprhodes opened this issue Aug 24, 2014 · 3 comments

Comments

@lprhodes
Copy link

Hi,

The following line of code doesn't escape all characters in URL's properly so we were having issues getting valid Embedly responses (often for links to Facebook images).

NSString *paramValue = [params[key] stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];

The following should be used instead:

(NSString *) CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef)urlString, NULL, (CFStringRef)@";/?:@&=$+{}<>,", CFStringConvertNSStringEncodingToEncoding(NSASCIIStringEncoding)));

@lprhodes
Copy link
Author

@tboetig @anrope @artgibson it'd be great to get this into the code base. This would be affecting all users using the iOS framework...

@anrope
Copy link
Contributor

anrope commented Sep 16, 2014

Hi,

Can you provide some more details? Maybe a couple example URLs that are affected by this?

Andy

@lprhodes
Copy link
Author

Check out http://stackoverflow.com/questions/3423545/objective-c-iphone-percent-encode-a-string

stringByAddingPercentEncodingWithAllowedCharacters is the way to go as of iOS 7

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

No branches or pull requests

2 participants