2005-07-19 Helge Hess <helge.hess@opengroupware.org>
+ * WOContext.m: properly generate multivalue query parameters (value is
+ an NSArray) (v4.5.176)
+
* NGObjWeb/WOApplication.h: added +isDirectConnectEnabled,
- +setCGIAdaptorURL:, +cgiAdaptorURL prototypes (v4.5.174)
+ +setCGIAdaptorURL:, +cgiAdaptorURL prototypes (v4.5.175)
* v4.5.174
qs = [MutableStrClass stringWithCapacity:256];
keys = [_queryDict keyEnumerator];
- for (isFirst = YES; (key = [keys nextObject]); ) {
- NSString *value;
+ for (isFirst = YES; (key = [keys nextObject]) != nil; ) {
+ id value;
- if (isFirst)
- isFirst = NO;
- else
- [qs appendString:self->qpJoin];
+ if (isFirst) isFirst = NO;
+ else [qs appendString:self->qpJoin];
+
+ value = [_queryDict objectForKey:key];
+ if ([value isKindOfClass:[NSArray class]]) {
+ NSArray *a = value;
+ unsigned i, count;
+
+ for (i = 0, count = [a count]; i < count; i++) {
+ value = [a objectAtIndex:i];
+
+ if (isFirst) isFirst = NO;
+ else [qs appendString:self->qpJoin];
+
+ // TODO: code duplication ...
+ value = ![value isNotNull] ? nil : [value stringValue];
+ key = [key stringByEscapingURL];
+ value = [value stringByEscapingURL];
- value = [[_queryDict objectForKey:key] stringValue];
+ [qs appendString:key];
+ if (value != nil) {
+ [qs appendString:@"="];
+ [qs appendString:value];
+ }
+ }
+ continue;
+ }
+ value = ![value isNotNull] ? nil : [value stringValue];
key = [key stringByEscapingURL];
value = [value stringByEscapingURL];
[qs appendString:key];
- if (value) {
+ if (value != nil) {
[qs appendString:@"="];
[qs appendString:value];
}