From 6be2b0f743c9ba0afb84520632b07a6ee063eefb Mon Sep 17 00:00:00 2001 From: davidearduini Date: Tue, 17 Apr 2018 12:25:44 +0200 Subject: [PATCH] Error TelephoneList --- src/main/php/eu/europa/cedefop/europass/xml2db.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/php/eu/europa/cedefop/europass/xml2db.php b/src/main/php/eu/europa/cedefop/europass/xml2db.php index 57bbe31..f0cb121 100644 --- a/src/main/php/eu/europa/cedefop/europass/xml2db.php +++ b/src/main/php/eu/europa/cedefop/europass/xml2db.php @@ -78,7 +78,11 @@ } if ($identification->getElementsByTagName("TelephoneList")) { $telephones = $identification->getElementsByTagName("TelephoneList"); - if ($telephones->length < 1) {$telephone=NULL; $telephone2=NULL; $telephone3=NULL;} + + $telephone=NULL; + $telephone2=NULL; + $telephone3=NULL; + foreach ($telephones as $telephone) { $index = 0; foreach ($identification->getElementsByTagName("Telephone") as $telephoneNode) { @@ -88,11 +92,9 @@ if ($index == 1 && $telephoneNode->getElementsByTagName("Contact")) { $telephone2 = $telephoneNode->getElementsByTagName("Contact")->item(0)->nodeValue; } - else {$telephone2 = NULL;} if ($index == 2 && $telephoneNode->getElementsByTagName("Contact")) { $telephone3 = $telephoneNode->getElementsByTagName("Contact")->item(0)->nodeValue; } - else {$telephone3 = NULL;} $index ++; } } @@ -516,4 +518,4 @@ echo '
Europass CV



'; echo 'The XML data have been loaded in the database successfuly.
'; echo 'Go Back'; -?> \ No newline at end of file +?>