summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/ipsec.inc12
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);
OpenPOWER on IntegriCloud