diff --git a/ChangeLog b/ChangeLog index 2ae09f965..0a10ffc98 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2010-09-02 Francis Lachapelle + + * UI/WebServerResources/generic.js (openMailTo): replaced calls to + encodeURI by encodeURIComponent to make sure symbols such as '?' + and '&' are encoded. + + * SoObjects/SOGo/NSDictionary+URL.m (-asURLParameters): escaped + keys and values using [NSString+misc stringByEscapingURL] from SOPE. + 2010-09-01 Wolfgang Sourdeau * Tests/Unit/SOGoTest.m (-run): fixed build on GNUstep >= 1.20. diff --git a/NEWS b/NEWS index 4dc8fdb9a..3bcb21ed9 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ - added support for Ctrl-C/Ctrl-V (copy/paste) in the calendar web module - now builds properly with gnustep-make 2.2 and above as well as gnustep-base 1.20 and above +- added return receipts support in the webmail interface 1.3-20100819 (1.3.1) -------------------- diff --git a/SoObjects/SOGo/NSDictionary+URL.m b/SoObjects/SOGo/NSDictionary+URL.m index e4daaf479..b2f248354 100644 --- a/SoObjects/SOGo/NSDictionary+URL.m +++ b/SoObjects/SOGo/NSDictionary+URL.m @@ -1,6 +1,6 @@ /* NSDictionary+URL.m - this file is part of SOGo * - * Copyright (C) 2006 Inverse inc. + * Copyright (C) 2006-2010 Inverse inc. * * Author: Wolfgang Sourdeau * @@ -24,6 +24,8 @@ #import #import +#import + #import "NSDictionary+URL.h" @implementation NSDictionary (SOGoURLExtension) @@ -32,10 +34,12 @@ { NSMutableString *urlParameters; NSArray *keys; + NSMutableArray *values; NSEnumerator *keysEnum; - NSString *currentKey, *separator; + NSString *currentKey, *separator ,*value; id currentValue; BOOL isFirst; + unsigned int i; urlParameters = [NSMutableString new]; [urlParameters autorelease]; @@ -51,13 +55,22 @@ currentValue = [self objectForKey: currentKey]; if ([currentValue isKindOfClass: [NSArray class]]) { + values = [NSMutableArray array]; separator = [NSString stringWithFormat: @"&%@=", currentKey]; + for (i = 0; i < [currentValue count]; i++) + { + value = [currentValue objectAtIndex: i]; + value = [value stringByEscapingURL]; + [values addObject: value]; + } currentValue - = [currentValue componentsJoinedByString: separator]; + = [values componentsJoinedByString: separator]; } + else + currentValue = [currentValue stringByEscapingURL]; [urlParameters appendFormat: @"%@%@=%@", ((isFirst) ? @"?" : @"&"), - currentKey, currentValue]; + [currentKey stringByEscapingURL], currentValue]; isFirst = NO; currentKey = [keysEnum nextObject]; } diff --git a/UI/WebServerResources/generic.js b/UI/WebServerResources/generic.js index 27bd51c14..531e6ebef 100644 --- a/UI/WebServerResources/generic.js +++ b/UI/WebServerResources/generic.js @@ -117,6 +117,7 @@ function extractEmailName(mailTo) { var tmpMailTo = mailTo.replace("<", "<"); tmpMailTo = tmpMailTo.replace(">", ">"); + tmpMailTo = tmpMailTo.replace("&", "&"); var emailNamere = /([ ]+)?(.+)\ 0) @@ -218,8 +219,8 @@ function openMailTo(senderMailTo) { if (mailto.length > 0) openMailComposeWindow(ApplicationBaseURL - + "../Mail/compose?mailto=" + encodeURI(mailto) - + ((subject.length > 0)?"?subject=" + encodeURI(subject):"")); + + "../Mail/compose?mailto=" + encodeURIComponent(mailto) + + ((subject.length > 0)?"?subject=" + encodeURIComponent(subject):"")); return false; /* stop following the link */ }