Commit 32aeeab6 authored by Franco Fichtner's avatar Franco Fichtner

routes: fix missing array() init (#108)

Small whitespace cleanups and style on top.
parent b3aa303c
...@@ -58,7 +58,6 @@ function parse_config() ...@@ -58,7 +58,6 @@ function parse_config()
} }
} }
// return config data as array, use old "listags" construction to mark certain elements as array (even if they're not recurring) // return config data as array, use old "listags" construction to mark certain elements as array (even if they're not recurring)
$config=$cnf->toArray(listtags()); $config=$cnf->toArray(listtags());
...@@ -66,7 +65,6 @@ function parse_config() ...@@ -66,7 +65,6 @@ function parse_config()
alias_make_table($config); alias_make_table($config);
return $config; return $config;
} }
/****f* config/convert_config /****f* config/convert_config
......
...@@ -32,8 +32,13 @@ require_once("functions.inc"); ...@@ -32,8 +32,13 @@ require_once("functions.inc");
require_once("filter.inc"); require_once("filter.inc");
require_once("shaper.inc"); require_once("shaper.inc");
if (!is_array($config['staticroutes']['route'])) if (!is_array($config['staticroutes'])) {
$config['staticroutes'] = array();
}
if (!is_array($config['staticroutes']['route'])) {
$config['staticroutes']['route'] = array(); $config['staticroutes']['route'] = array();
}
$a_routes = &$config['staticroutes']['route']; $a_routes = &$config['staticroutes']['route'];
$a_gateways = return_gateways_array(true, true, true); $a_gateways = return_gateways_array(true, true, true);
......
...@@ -35,8 +35,13 @@ require_once("gwlb.inc"); ...@@ -35,8 +35,13 @@ require_once("gwlb.inc");
$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/system_routes.php'); $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/system_routes.php');
if (!is_array($config['staticroutes']['route'])) if (!is_array($config['staticroutes'])) {
$config['staticroutes'] = array();
}
if (!is_array($config['staticroutes']['route'])) {
$config['staticroutes']['route'] = array(); $config['staticroutes']['route'] = array();
}
$a_routes = &$config['staticroutes']['route']; $a_routes = &$config['staticroutes']['route'];
$a_gateways = return_gateways_array(true, true); $a_gateways = return_gateways_array(true, true);
......
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