Commit f21708cb authored by Franco Fichtner's avatar Franco Fichtner

aliases: fix missing array() init in config structure

parent 4ee0a0a4
...@@ -140,9 +140,12 @@ function easyrule_block_alias_add($host, $int = 'wan') { ...@@ -140,9 +140,12 @@ function easyrule_block_alias_add($host, $int = 'wan') {
return false; return false;
/* If there are no aliases, start an array */ /* If there are no aliases, start an array */
if (!is_array($config['aliases']['alias'])) if (!is_array($config['aliases'])) {
$config['aliases'] = array();
}
if (!is_array($config['aliases']['alias'])) {
$config['aliases']['alias'] = array(); $config['aliases']['alias'] = array();
}
$a_aliases = &$config['aliases']['alias']; $a_aliases = &$config['aliases']['alias'];
/* Try to get the ID if the alias already exists */ /* Try to get the ID if the alias already exists */
......
...@@ -36,9 +36,9 @@ require_once("shaper.inc"); ...@@ -36,9 +36,9 @@ require_once("shaper.inc");
if (!is_array($config['aliases'])) { if (!is_array($config['aliases'])) {
$config['aliases'] = array(); $config['aliases'] = array();
} }
if (!is_array($config['aliases']['alias'])) {
if (!is_array($config['aliases']['alias']))
$config['aliases']['alias'] = array(); $config['aliases']['alias'] = array();
}
$a_aliases = &$config['aliases']['alias']; $a_aliases = &$config['aliases']['alias'];
$tab = ($_REQUEST['tab'] == "" ? "ip" : preg_replace("/\W/","",$_REQUEST['tab'])); $tab = ($_REQUEST['tab'] == "" ? "ip" : preg_replace("/\W/","",$_REQUEST['tab']));
......
...@@ -50,12 +50,12 @@ if (is_array($config['load_balancer']['lbpool'])) ...@@ -50,12 +50,12 @@ if (is_array($config['load_balancer']['lbpool']))
$reserved_ifs = get_configured_interface_list(false, true); $reserved_ifs = get_configured_interface_list(false, true);
$reserved_keywords = array_merge($reserved_keywords, $reserved_ifs, $reserved_table_names); $reserved_keywords = array_merge($reserved_keywords, $reserved_ifs, $reserved_table_names);
if (!is_array($config['aliases'])){ if (!is_array($config['aliases'])) {
$config['aliases'] = array(); $config['aliases'] = array();
} }
if (!is_array($config['aliases']['alias'])) {
if (!is_array($config['aliases']['alias']))
$config['aliases']['alias'] = array(); $config['aliases']['alias'] = array();
}
$a_aliases = &$config['aliases']['alias']; $a_aliases = &$config['aliases']['alias'];
$tab = $_REQUEST['tab']; $tab = $_REQUEST['tab'];
......
...@@ -50,9 +50,9 @@ $reserved_keywords = array_merge($reserved_keywords, $reserved_ifs, $reserved_ta ...@@ -50,9 +50,9 @@ $reserved_keywords = array_merge($reserved_keywords, $reserved_ifs, $reserved_ta
if (!is_array($config['aliases'])) { if (!is_array($config['aliases'])) {
$config['aliases'] = array(); $config['aliases'] = array();
} }
if (!is_array($config['aliases']['alias'])) {
if (!is_array($config['aliases']['alias']))
$config['aliases']['alias'] = array(); $config['aliases']['alias'] = array();
}
$a_aliases = &$config['aliases']['alias']; $a_aliases = &$config['aliases']['alias'];
if($_POST['aliasimport'] <> "") { if($_POST['aliasimport'] <> "") {
......
...@@ -42,8 +42,12 @@ if (!is_array($config['nat']['outbound']['rule'])) { ...@@ -42,8 +42,12 @@ if (!is_array($config['nat']['outbound']['rule'])) {
$a_out = &$config['nat']['outbound']['rule']; $a_out = &$config['nat']['outbound']['rule'];
if (!is_array($config['aliases']['alias'])) if (!is_array($config['aliases'])) {
$config['aliases'] = array();
}
if (!is_array($config['aliases']['alias'])) {
$config['aliases']['alias'] = array(); $config['aliases']['alias'] = array();
}
$a_aliases = &$config['aliases']['alias']; $a_aliases = &$config['aliases']['alias'];
if (is_numericint($_GET['id'])) if (is_numericint($_GET['id']))
......
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