mirror of
https://github.com/zxing/zxing.git
synced 2024-11-10 04:54:04 -08:00
correctly seperate args in url
git-svn-id: https://zxing.googlecode.com/svn/trunk@2629 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
12387c2f81
commit
0badbf57ae
|
@ -30,13 +30,14 @@
|
|||
if (!url) return NO;
|
||||
if ([[url scheme] isEqualToString:@"zxing"]) {
|
||||
if ([[url host] isEqualToString:@"scan"]) {
|
||||
NSArray *pairs = [[url query] componentsSeparatedByString:@"&"];
|
||||
NSArray *pairs = [[url query] componentsSeparatedByString:@"&"];
|
||||
|
||||
for (NSString *pair in pairs) {
|
||||
NSArray *elements = [pair componentsSeparatedByString:@"="];
|
||||
NSString *key = [[elements objectAtIndex:0] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
|
||||
NSString *val = [[elements objectAtIndex:1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
|
||||
|
||||
// NSLog(@"%@ => %@\n", key, val);
|
||||
|
||||
if ([key isEqualToString:@"ret"]) {
|
||||
[[NSUserDefaults standardUserDefaults] setObject:val forKey:@"returnURL"];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
|
|
Loading…
Reference in a new issue