mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-21 03:15:25 +00:00
Fixed crashes with IE7+8
Monotone-Parent: 33b6c38a250d6ae49e26dd7de548708c132d5c34 Monotone-Revision: 95ed8a2f8950868651d78738a3745fb83e43881a Monotone-Author: crobert@inverse.ca Monotone-Date: 2009-09-03T18:24:05 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -231,7 +231,7 @@
|
||||
{
|
||||
WORequest *request;
|
||||
WOResponse *response;
|
||||
NSData *data;
|
||||
id data;
|
||||
NSMutableDictionary *rc;
|
||||
NSString *fileContent;
|
||||
int imported = 0;
|
||||
@@ -239,10 +239,15 @@
|
||||
|
||||
request = [context request];
|
||||
rc = [NSMutableDictionary dictionary];
|
||||
data = (NSData *)[request formValueForKey: @"contactsFile"];
|
||||
fileContent = [[NSString alloc] initWithData: data
|
||||
encoding: NSUTF8StringEncoding];
|
||||
[fileContent autorelease];
|
||||
data = [request formValueForKey: @"contactsFile"];
|
||||
if ([data respondsToSelector: @selector(isEqualToString:)])
|
||||
fileContent = (NSString *) data;
|
||||
else
|
||||
{
|
||||
fileContent = [[NSString alloc] initWithData: (NSData *) data
|
||||
encoding: NSUTF8StringEncoding];
|
||||
[fileContent autorelease];
|
||||
}
|
||||
|
||||
if (fileContent && [fileContent length])
|
||||
{
|
||||
@@ -265,6 +270,8 @@
|
||||
forKey: @"message"];
|
||||
|
||||
response = [self responseWithStatus: 200];
|
||||
[response setHeader: @"text/html"
|
||||
forKey: @"content-type"];
|
||||
[(WOResponse*)response appendContentString: [rc jsonRepresentation]];
|
||||
|
||||
return response;
|
||||
|
||||
Reference in New Issue
Block a user