diff options
author | Renato Botelho <renato@netgate.com> | 2015-11-03 17:54:57 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-11-03 17:54:57 -0200 |
commit | de0ecc0e071f5f3c677ae16513fa36538576ebfd (patch) | |
tree | c74d84fa7c211d971e8e8efe42e45858625c98d0 | |
parent | d6d9144e203f6fc350b4c96dc49271553e121b02 (diff) | |
download | pfsense-RELENG_2_2_5.zip pfsense-RELENG_2_2_5.tar.gz |
A new fix for #4130:RELENG_2_2_5
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
-rw-r--r-- | etc/inc/ipsec.inc | 12 |
1 files 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); |