See Changelog.

Monotone-Parent: 2ddbb7513b1b8ba7d0d14c8cb60d801fac9314a6
Monotone-Revision: 1f2eaa372e3ae66a929fc22a568735d95ec1f67f

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2010-09-02T19:11:20
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Francis Lachapelle 2010-09-02 19:11:20 +00:00
parent b7c9ebdd45
commit 428b086ff8
4 changed files with 31 additions and 7 deletions

View File

@ -1,3 +1,12 @@
2010-09-02 Francis Lachapelle <flachapelle@inverse.ca>
* 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 <wsourdeau@inverse.ca> 2010-09-01 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* Tests/Unit/SOGoTest.m (-run): fixed build on GNUstep >= 1.20. * Tests/Unit/SOGoTest.m (-run): fixed build on GNUstep >= 1.20.

1
NEWS
View File

@ -4,6 +4,7 @@
- added support for Ctrl-C/Ctrl-V (copy/paste) in the calendar web module - 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 - now builds properly with gnustep-make 2.2 and above as well as gnustep-base
1.20 and above 1.20 and above
- added return receipts support in the webmail interface
1.3-20100819 (1.3.1) 1.3-20100819 (1.3.1)
-------------------- --------------------

View File

@ -1,6 +1,6 @@
/* NSDictionary+URL.m - this file is part of SOGo /* NSDictionary+URL.m - this file is part of SOGo
* *
* Copyright (C) 2006 Inverse inc. * Copyright (C) 2006-2010 Inverse inc.
* *
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca> * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* *
@ -24,6 +24,8 @@
#import <Foundation/NSEnumerator.h> #import <Foundation/NSEnumerator.h>
#import <Foundation/NSString.h> #import <Foundation/NSString.h>
#import <NGExtensions/NSString+misc.h>
#import "NSDictionary+URL.h" #import "NSDictionary+URL.h"
@implementation NSDictionary (SOGoURLExtension) @implementation NSDictionary (SOGoURLExtension)
@ -32,10 +34,12 @@
{ {
NSMutableString *urlParameters; NSMutableString *urlParameters;
NSArray *keys; NSArray *keys;
NSMutableArray *values;
NSEnumerator *keysEnum; NSEnumerator *keysEnum;
NSString *currentKey, *separator; NSString *currentKey, *separator ,*value;
id currentValue; id currentValue;
BOOL isFirst; BOOL isFirst;
unsigned int i;
urlParameters = [NSMutableString new]; urlParameters = [NSMutableString new];
[urlParameters autorelease]; [urlParameters autorelease];
@ -51,13 +55,22 @@
currentValue = [self objectForKey: currentKey]; currentValue = [self objectForKey: currentKey];
if ([currentValue isKindOfClass: [NSArray class]]) if ([currentValue isKindOfClass: [NSArray class]])
{ {
values = [NSMutableArray array];
separator = [NSString stringWithFormat: @"&%@=", currentKey]; separator = [NSString stringWithFormat: @"&%@=", currentKey];
for (i = 0; i < [currentValue count]; i++)
{
value = [currentValue objectAtIndex: i];
value = [value stringByEscapingURL];
[values addObject: value];
}
currentValue currentValue
= [currentValue componentsJoinedByString: separator]; = [values componentsJoinedByString: separator];
} }
else
currentValue = [currentValue stringByEscapingURL];
[urlParameters appendFormat: @"%@%@=%@", [urlParameters appendFormat: @"%@%@=%@",
((isFirst) ? @"?" : @"&"), ((isFirst) ? @"?" : @"&"),
currentKey, currentValue]; [currentKey stringByEscapingURL], currentValue];
isFirst = NO; isFirst = NO;
currentKey = [keysEnum nextObject]; currentKey = [keysEnum nextObject];
} }

View File

@ -117,6 +117,7 @@ function extractEmailName(mailTo) {
var tmpMailTo = mailTo.replace("&lt;", "<"); var tmpMailTo = mailTo.replace("&lt;", "<");
tmpMailTo = tmpMailTo.replace("&gt;", ">"); tmpMailTo = tmpMailTo.replace("&gt;", ">");
tmpMailTo = tmpMailTo.replace("&amp;", "&");
var emailNamere = /([ ]+)?(.+)\ </; var emailNamere = /([ ]+)?(.+)\ </;
if (emailNamere.test(tmpMailTo)) { if (emailNamere.test(tmpMailTo)) {
@ -207,7 +208,7 @@ function openMailComposeWindow(url, wId) {
function openMailTo(senderMailTo) { function openMailTo(senderMailTo) {
var addresses = senderMailTo.split(","); var addresses = senderMailTo.split(",");
var sanitizedAddresses = new Array(); var sanitizedAddresses = new Array();
var subject = extractSubject(senderMailTo); var subject = extractSubject(senderMailTo);
for (var i = 0; i < addresses.length; i++) { for (var i = 0; i < addresses.length; i++) {
var sanitizedAddress = sanitizeMailTo(addresses[i]); var sanitizedAddress = sanitizeMailTo(addresses[i]);
if (sanitizedAddress.length > 0) if (sanitizedAddress.length > 0)
@ -218,8 +219,8 @@ function openMailTo(senderMailTo) {
if (mailto.length > 0) if (mailto.length > 0)
openMailComposeWindow(ApplicationBaseURL openMailComposeWindow(ApplicationBaseURL
+ "../Mail/compose?mailto=" + encodeURI(mailto) + "../Mail/compose?mailto=" + encodeURIComponent(mailto)
+ ((subject.length > 0)?"?subject=" + encodeURI(subject):"")); + ((subject.length > 0)?"?subject=" + encodeURIComponent(subject):""));
return false; /* stop following the link */ return false; /* stop following the link */
} }