From a2133130621154c41a46817118e6963b78f00b80 Mon Sep 17 00:00:00 2001 From: mkuba50 Date: Fri, 16 Nov 2018 21:29:29 +0100 Subject: [PATCH] Handle XML load error --- get.php | 7 ++++++- shared/main.php | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/get.php b/get.php index 5c96e46..de1dd96 100644 --- a/get.php +++ b/get.php @@ -216,7 +216,12 @@ function uupGetFiles( } consoleLogger('Parsing information...'); - $xmlOut = simplexml_load_string($out); + $xmlOut = @simplexml_load_string($out); + if($xmlOut === false) { + unlink('cache/'.$cacheHash.'.json.gz'); + return array('error' => 'ERROR'); + } + $xmlBody = $xmlOut->children('s', true)->Body->children(); if(!isset($xmlBody->GetExtendedUpdateInfo2Response)) { diff --git a/shared/main.php b/shared/main.php index 20f9d93..6c1e062 100644 --- a/shared/main.php +++ b/shared/main.php @@ -16,7 +16,7 @@ limitations under the License. */ function uupApiVersion() { - return '1.16.0'; + return '1.16.1'; } require_once dirname(__FILE__).'/auths.php';