From f878f13803d6f02975c316be9cf9102a69bb90e3 Mon Sep 17 00:00:00 2001 From: Souta Ito Date: Thu, 2 Jun 2016 16:12:27 +0900 Subject: [PATCH] Skip invalid element name --- app/array2xml.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/array2xml.php b/app/array2xml.php index e1b5910..9cdaf07 100644 --- a/app/array2xml.php +++ b/app/array2xml.php @@ -292,9 +292,11 @@ private function _getXML(&$data, $tabs_count = 0) if ($key !== FALSE) { $this->writer->text(str_repeat($this->newTab, $tabs_count)); - - $this->writer->startElement($key); - + try { + $this->writer->startElement($key); + } catch(Exception $e) { + continue; + } if ($attrKey !== FALSE && isset($this->elementsAttrs[$attrKey])) { foreach ($this->elementsAttrs[$attrKey] as $elementAttrName => $elementAttrText)