mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Ensure this is always an array to avoid a PHP error from foreach.
This commit is contained in:
parent
154298f196
commit
bc0a452fb4
@ -37,7 +37,11 @@ require("guiconfig.inc");
|
||||
$host = trim($_REQUEST['host'], " \t\n\r\0\x0B[];\"'");
|
||||
$host_esc = escapeshellarg($host);
|
||||
|
||||
$a_aliases = &$config['aliases']['alias'];
|
||||
if (is_array($config['aliases']['alias'])) {
|
||||
$a_aliases = &$config['aliases']['alias'];
|
||||
} else {
|
||||
$a_aliases = array();
|
||||
}
|
||||
$aliasname = str_replace(array(".","-"), "_", $host);
|
||||
$alias_exists = false;
|
||||
$counter=0;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user