From e66ceaad0770c8487fafef96566cb263df970f55 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Thu, 10 Apr 2014 09:40:25 -0400 Subject: [PATCH] Fixed gcc warnings and added some rationale around yesterday's fix --- ActiveSync/NGDOMElement+ActiveSync.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ActiveSync/NGDOMElement+ActiveSync.m b/ActiveSync/NGDOMElement+ActiveSync.m index 421db0a3c..1a44e8a95 100644 --- a/ActiveSync/NGDOMElement+ActiveSync.m +++ b/ActiveSync/NGDOMElement+ActiveSync.m @@ -119,9 +119,13 @@ static NSArray *asElementArray = nil; tag = [element tagName]; count = [(NSArray *)[element childNodes] count]; - if ([element isTextNode]) + // We check if the node is a text one or if all its + // children are text nodes. This is important to avoid side-effects + // in SOPE where "foo & bar" would result into 3 childnodes instead + // of just one. + if ([(id)element isTextNode]) { - value = [element textValue]; + value = [(id)element textValue]; } // Handle inner data - see above for samples else