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]; } }