diff --git a/app/Console/Commands/Xml.php b/app/Console/Commands/Xml.php index 769f33c5..c9210b90 100644 --- a/app/Console/Commands/Xml.php +++ b/app/Console/Commands/Xml.php @@ -3,6 +3,7 @@ namespace App\Console\Commands; use App\Utilities\Notice; +use Log; use SimpleXMLElement; class Xml @@ -96,8 +97,11 @@ class Xml sleep(2); // Optional: Sleep between retries } else { curl_close($ch); - - return new SimpleXMLElement($response); + if (mb_substr($response, 0, 1) != '<') { + Log::debug('INVALID XML '.$url); + } else { + return new SimpleXMLElement($response); + } } } echo "All attempts failed.\n";