From b4fe7d040c4354fce0dc2aee05366d71bd118902 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 4 Jun 2009 15:08:03 +0000 Subject: [PATCH] Monotone-Parent: fbaf51f1b9944aee510a816b001f424db9802648 Monotone-Revision: 9b5d407f9ae321995a0df2c39bcac77dc375d302 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-06-04T15:08:03 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ UI/SOGoUI/UIxComponent.m | 11 +++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 39eeb62a7..01f1a5c5b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-06-04 Wolfgang Sourdeau + * UI/SOGoUI/UIxComponent.m (-_parseQueryString:): fixed handling + of bad charsets in the parameters encoding. Invalid values will be + discarded. + * SoObjects/Contacts/SOGoContactGCSFolder.m (-lookupContactsWithFilter:sortBy:ordering:): same as below. diff --git a/UI/SOGoUI/UIxComponent.m b/UI/SOGoUI/UIxComponent.m index 936d4e21d..8e5a5c7d6 100644 --- a/UI/SOGoUI/UIxComponent.m +++ b/UI/SOGoUI/UIxComponent.m @@ -154,24 +154,23 @@ static BOOL uixDebugEnabled = NO; NSString *key, *value; e = [[_s componentsSeparatedByString:@"&"] objectEnumerator]; - part = [e nextObject]; - while (part) + while ((part = [e nextObject])) { r = [part rangeOfString:@"="]; if (r.length == 0) { /* missing value of query parameter */ - key = [part stringByUnescapingURL]; + key = [part stringByUnescapingURL]; value = @"1"; } else { - key = [[part substringToIndex:r.location] stringByUnescapingURL]; + key = [[part substringToIndex:r.location] stringByUnescapingURL]; value = [[part substringFromIndex:(r.location + r.length)] stringByUnescapingURL]; } - [queryParameters setObject:value forKey:key]; - part = [e nextObject]; + if (key && value) + [queryParameters setObject:value forKey:key]; } }