Skip to content

Commit

Permalink
interfaces: another issue related to new config system; fixes #128
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Apr 3, 2015
1 parent 58ae995 commit 6fa394b
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/www/interfaces.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,33 @@
define("CRON_DAILY_PATTERN", "0 0 * * *");
define("CRON_HOURLY_PATTERN", "0 * * * *");

if (!is_array($pconfig))
if (!is_array($pconfig)) {
$pconfig = array();
}

if (!is_array($config['ppps'])) {
$config['ppps'] = array();
}

if (!is_array($config['ppps']['ppp']))
if (!is_array($config['ppps']['ppp'])) {
$config['ppps']['ppp'] = array();
}

$a_ppps = &$config['ppps']['ppp'];

function remove_bad_chars($string) {
function remove_bad_chars($string)
{
return preg_replace('/[^a-z_0-9]/i','',$string);
}

if (!is_array($config['gateways']['gateway_item']))
if (!is_array($config['gateways'])) {
$config['gateways'] = array();
}

if (!is_array($config['gateways']['gateway_item'])) {
$config['gateways']['gateway_item'] = array();
}

$a_gateways = &$config['gateways']['gateway_item'];

$wancfg = &$config['interfaces'][$if];
Expand Down

0 comments on commit 6fa394b

Please sign in to comment.