From 5e4a00730791e60d213e90895087bf8dc12824f8 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 11 Apr 2016 13:36:20 +0200 Subject: [PATCH] (systemhealth) don't generate crash report on empty or invalid rrd xml data --- .../OPNsense/Diagnostics/Api/SystemhealthController.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/Api/SystemhealthController.php b/src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/Api/SystemhealthController.php index a06bdbacb..df7ba3fd2 100644 --- a/src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/Api/SystemhealthController.php +++ b/src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/Api/SystemhealthController.php @@ -542,13 +542,11 @@ class SystemhealthController extends ApiControllerBase */ $rrd_details=$this->getRRDdetails($rrd)["data"]; - + $xml = false; if ($rrd_details['filename'] != "") { $backend = new Backend(); $response = $backend->configdpRun("systemhealth fetch ", array($rrd_details['filename'])); - $xml = simplexml_load_string($response); /* XXX can cause a crash report */ - } else { - $xml = false; + $xml = @simplexml_load_string($response); } if ($xml !== false) {