diff --git a/lib/Froxlor/Ajax/Ajax.php b/lib/Froxlor/Ajax/Ajax.php index 6c48ee30..c6a0b700 100644 --- a/lib/Froxlor/Ajax/Ajax.php +++ b/lib/Froxlor/Ajax/Ajax.php @@ -120,23 +120,33 @@ class Ajax // Check for simplexml_load_file if (!function_exists("simplexml_load_file")) { - return $this->errorResponse( + return $this->errorResponse([ "Newsfeed not available due to missing php-simplexml extension", "Please install the php-simplexml extension in order to view our newsfeed." - ); + ]); } // Check for curl_version if (!function_exists('curl_version')) { - return $this->errorResponse( + return $this->errorResponse([ "Newsfeed not available due to missing php-curl extension", "Please install the php-curl extension in order to view our newsfeed." - ); + ]); } $output = HttpClient::urlGet($feed); $news = simplexml_load_string(trim($output)); + if ($news === false) { + $err = []; + foreach(libxml_get_errors() as $error) { + $err[] = $error->message; + } + return $this->errorResponse( + $err + ); + } + // Handle items if ($news) { $items = null; diff --git a/templates/Froxlor/user/index.html.twig b/templates/Froxlor/user/index.html.twig index 703a2407..889f708b 100644 --- a/templates/Froxlor/user/index.html.twig +++ b/templates/Froxlor/user/index.html.twig @@ -280,10 +280,10 @@ {% endif %} {% if (get_setting('admin.show_news_feed') == 1 and userinfo.adminsession == 1) or (get_setting('customer.show_news_feed') == 1 and userinfo.adminsession == 0) %} -