Project

General

Profile

« Previous | Next » 

Revision de0ecc0e

Added by Renato Botelho almost 10 years ago

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

View differences:

etc/inc/ipsec.inc
559 559
		return array();
560 560
	}
561 561

  
562
	/* This is needed for fixing #4130 */
563
	if (filesize("{$g['tmp_path']}/strongswan_leases.xml") < 200) {
562
	if (filesize("{$g['tmp_path']}/strongswan_leases.xml") == 0) {
564 563
		return array();
565 564
	}
566 565

  
566
	if (!function_exists('parse_xml_config')) {
567
		require_once('xmlparse.inc');
568
	}
569

  
567 570
	$custom_listtags = array('lease', 'pool');
568 571
	$response = parse_xml_config("{$g['tmp_path']}/strongswan_leases.xml", "leases");
572

  
573
	if ($response == -1) {
574
		return array();
575
	}
576

  
569 577
	@unlink("{$g['tmp_path']}/strongswan_leases.xml");
570 578
	unset($custom_listtags, $_gb);
571 579

  

Also available in: Unified diff