Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
(fix) properly split long headers (fixes #3152)
  • Loading branch information
extrafu committed Mar 16, 2016
1 parent 188328d commit bed5175
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ActiveSync/SOGoActiveSyncDispatcher.m
Expand Up @@ -2862,7 +2862,7 @@ - (void) _processSmartCommand: (id <DOMElement>) theDocumentElement
{
[map setObject: [mailObject messageId] forKey: @"in-reply-to"];

references = [[[[[mailObject mailHeaders] objectForKey: @"references"] componentsSeparatedByString: @" "] mutableCopy] autorelease];
references = [[[[[mailObject mailHeaders] objectForKey: @"references"] componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] mutableCopy] autorelease];

// If there is no References: header, initialize it with In-Reply-To.
if ([mailObject inReplyTo] && ![references count])
Expand Down
5 changes: 3 additions & 2 deletions ActiveSync/SOGoMailObject+ActiveSync.m
Expand Up @@ -34,6 +34,7 @@
#import <Foundation/NSDictionary.h>
#import <Foundation/NSException.h>
#import <Foundation/NSString.h>
#import <Foundation/NSCharacterSet.h>

#import <NGCards/iCalCalendar.h>
#import <NGCards/iCalDateTime.h>
Expand Down Expand Up @@ -1187,9 +1188,9 @@ - (NSString *) activeSyncRepresentationInContext: (WOContext *) _context
value = [[self mailHeaders] objectForKey: @"references"];

if ([value isKindOfClass: [NSArray class]])
reference = [[[value objectAtIndex: 0] componentsSeparatedByString: @" "] objectAtIndex: 0];
reference = [[[value objectAtIndex: 0] componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] objectAtIndex: 0];
else
reference = [[value componentsSeparatedByString: @" "] objectAtIndex: 0];
reference = [[value componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] objectAtIndex: 0];

if ([reference length] > 0)
[s appendFormat: @"<ConversationId xmlns=\"Email2:\">%@</ConversationId>", [[reference dataUsingEncoding: NSUTF8StringEncoding] activeSyncRepresentationInContext: context]];
Expand Down

0 comments on commit bed5175

Please sign in to comment.