Commit e8496219 authored by Franco Fichtner's avatar Franco Fichtner

src: fix crash reports

parent 3644a724
......@@ -382,14 +382,23 @@ function filter_generate_scrubing() {
}
/* disable scrub option */
foreach ($FilterIflist as $scrubif => $scrubcfg) {
if(isset($scrubcfg['virtual']) || empty($scrubcfg['descr']))
if (isset($scrubcfg['virtual']) || empty($scrubcfg['descr'])) {
continue;
}
/* set up MSS clamping */
if($scrubcfg['mss'] <> "" && is_numeric($scrubcfg['mss']) && isset($scrubcfg['if']) && $scrubcfg['if'] != "pppoe" && $scrubcfg['if'] != "pptp" &&
$scrubif['if'] != "l2tp")
$mssclamp = "max-mss " . (intval($scrubcfg['mss'] - 40));
else
$mssclamp = "";
if (isset($scrubcfg['if'])) {
if (
$scrubcfg['mss'] != '' && is_numeric($scrubcfg['mss']) &&
$scrubcfg['if'] != 'pppoe' && $scrubcfg['if'] != 'pptp' &&
$scrubif['if'] != 'l2tp'
) {
$mssclamp = "max-mss " . (intval($scrubcfg['mss'] - 40));
} else {
$mssclamp = '';
}
}
/* configure no-df for linux nfs and others */
if(!empty($config['system']['scrubnodf']))
$scrubnodf = "no-df";
......
......@@ -87,10 +87,13 @@ $protos = array('icmp', 'icmp6', 'tcp', 'udp', 'arp', 'carp', 'esp',
$input_errors = array();
$interfaces = get_configured_interface_with_descr();
if (isset($config['ipsec']['enable']))
$interfaces['ipsec'] = "IPsec";
if (isset($config['ipsec']['enable'])) {
$interfaces['ipsec'] = 'IPsec';
}
foreach (array('server', 'client') as $mode) {
if (is_array($config['openvpn']["openvpn-{$mode}"])) {
if (isset($config['openvpn']["openvpn-{$mode}"])) {
foreach ($config['openvpn']["openvpn-{$mode}"] as $id => $setting) {
if (!isset($setting['disable'])) {
$interfaces['ovpn' . substr($mode, 0, 1) . $setting['vpnid']] = gettext("OpenVPN") . " ".$mode.": ".htmlspecialchars($setting['description']);
......
......@@ -29,8 +29,9 @@
require_once("guiconfig.inc");
require_once("interfaces.inc");
if (!is_array($config['gifs']['gif']))
if (!isset($config['gifs']['gif'])) {
$config['gifs']['gif'] = array();
}
$a_gifs = &$config['gifs']['gif'] ;
......
......@@ -39,11 +39,11 @@ define("CRON_WEEKLY_PATTERN", "0 0 * * 0");
define("CRON_DAILY_PATTERN", "0 0 * * *");
define("CRON_HOURLY_PATTERN", "0 * * * *");
if (!is_array($config['ppps'])) {
if (!isset($config['ppps'])) {
$config['ppps'] = array();
}
if (!is_array($config['ppps']['ppp'])) {
if (!isset($config['ppps']['ppp'])) {
$config['ppps']['ppp'] = array();
}
......@@ -53,7 +53,7 @@ $iflist = get_configured_interface_with_descr();
$portlist = get_interface_list();
$portlist = array_merge($portlist, $iflist);
if (is_array($config['vlans']['vlan']) && count($config['vlans']['vlan'])) {
if (isset($config['vlans']['vlan'])) {
foreach ($config['vlans']['vlan'] as $vlan) {
$portlist[$vlan['vlanif']] = $vlan;
}
......@@ -156,8 +156,9 @@ if (isset($id) && $a_ppps[$id]) {
break;
}
} else
} else {
$pconfig['ptpid'] = interfaces_ptpid_next();
}
if ($_POST) {
......@@ -444,7 +445,10 @@ $types = array("select" => gettext("Select"), "ppp" => "PPP", "pppoe" => "PPPoE"
</tr>
<tr style="display:none" name="portlists" id="portlists">
<td id="serialports"><?php
$selected_ports = explode(',',$pconfig['interfaces']);
$selected_ports = array();
if (isset($pconfig['interfaces'])) {
$selected_ports = explode(',',isset($pconfig['interfaces']));
}
if (!is_dir('/var/spool/lock')) {
mwexec('/bin/mkdir -p /var/spool/lock');
}
......
......@@ -33,11 +33,16 @@ require_once("pfsense-utils.inc");
require_once("interfaces.inc");
$pconfig['enable'] = isset($config['dhcrelay']['enable']);
if (empty($config['dhcrelay']['interface']))
if (empty($config['dhcrelay']['interface'])) {
$pconfig['interface'] = array();
else
} else {
$pconfig['interface'] = explode(",", $config['dhcrelay']['interface']);
$pconfig['server'] = $config['dhcrelay']['server'];
}
if (!isset($config['dhcrelay']['server'])) {
$pconfig['server'] = array();
} else {
$pconfig['server'] = $config['dhcrelay']['server'];
}
$pconfig['agentoption'] = isset($config['dhcrelay']['agentoption']);
$iflist = get_configured_interface_with_descr();
......
......@@ -42,7 +42,7 @@ function is_dyndns_username($uname) {
return true;
}
if (!is_array($config['dyndnses']['dyndns'])) {
if (!isset($config['dyndnses']['dyndns'])) {
$config['dyndnses']['dyndns'] = array();
}
......
......@@ -36,7 +36,7 @@ require_once("openvpn-client-export.inc");
$pgtitle = array("OpenVPN", "Client Export Utility");
if (!is_array($config['openvpn']['openvpn-server'])) {
if (!isset($config['openvpn']['openvpn-server'])) {
$config['openvpn']['openvpn-server'] = array();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment