From de0ecc0e071f5f3c677ae16513fa36538576ebfd Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Tue, 3 Nov 2015 17:54:57 -0200 Subject: A new fix for #4130: The fix added for this bug, that check xml file size is < 200 to decide if file must or not be read created a new issue, single entry is not showed. Instead of doing this, check parse_xml_config() return and return empty array when it's -1 While here, prevent errors saying parse_xml_config() doesn't exist and make sure xmlparse.inc is required --- etc/inc/ipsec.inc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/etc/inc/ipsec.inc b/etc/inc/ipsec.inc index b60dd49..8a27623 100644 --- a/etc/inc/ipsec.inc +++ b/etc/inc/ipsec.inc @@ -559,13 +559,21 @@ function ipsec_dump_mobile() { return array(); } - /* This is needed for fixing #4130 */ - if (filesize("{$g['tmp_path']}/strongswan_leases.xml") < 200) { + if (filesize("{$g['tmp_path']}/strongswan_leases.xml") == 0) { return array(); } + if (!function_exists('parse_xml_config')) { + require_once('xmlparse.inc'); + } + $custom_listtags = array('lease', 'pool'); $response = parse_xml_config("{$g['tmp_path']}/strongswan_leases.xml", "leases"); + + if ($response == -1) { + return array(); + } + @unlink("{$g['tmp_path']}/strongswan_leases.xml"); unset($custom_listtags, $_gb); -- cgit v1.1