From 35aadaf0c82be71875137f0383c6a29613b67673 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Mon, 12 Apr 2010 10:55:07 +0000 Subject: [PATCH] Fixed regression parsing KML with CDATA blocks. r=bartvde (pullup #2398) git-svn-id: http://svn.openlayers.org/trunk/openlayers@10200 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Format/KML.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/OpenLayers/Format/KML.js b/lib/OpenLayers/Format/KML.js index e8ccba5060..e5de5b4729 100644 --- a/lib/OpenLayers/Format/KML.js +++ b/lib/OpenLayers/Format/KML.js @@ -885,7 +885,7 @@ OpenLayers.Format.KML = OpenLayers.Class(OpenLayers.Format.XML, { child = children[i]; if(child.nodeType == 1) { grandchildren = child.childNodes; - if(grandchildren.length >= 1 || grandchildren.length <= 3) { + if(grandchildren.length >= 1 && grandchildren.length <= 3) { var grandchild; switch (grandchildren.length) { case 1: @@ -894,7 +894,7 @@ OpenLayers.Format.KML = OpenLayers.Class(OpenLayers.Format.XML, { case 2: var c1 = grandchildren[0]; var c2 = grandchildren[1]; - grandchild = c1.nodeType == 3 || c1.nodeType == 4 ? + grandchild = (c1.nodeType == 3 || c1.nodeType == 4) ? c1 : c2; break; case 3: