Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
f21708cb
Commit
f21708cb
authored
Apr 05, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aliases: fix missing array() init in config structure
parent
4ee0a0a4
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
10 deletions
+17
-10
easyrule.inc
src/etc/inc/easyrule.inc
+5
-2
firewall_aliases.php
src/www/firewall_aliases.php
+2
-2
firewall_aliases_edit.php
src/www/firewall_aliases_edit.php
+3
-3
firewall_aliases_import.php
src/www/firewall_aliases_import.php
+2
-2
firewall_nat_out_edit.php
src/www/firewall_nat_out_edit.php
+5
-1
No files found.
src/etc/inc/easyrule.inc
View file @
f21708cb
...
@@ -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 */
...
...
src/www/firewall_aliases.php
View file @
f21708cb
...
@@ -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'
]));
...
...
src/www/firewall_aliases_edit.php
View file @
f21708cb
...
@@ -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'
];
...
...
src/www/firewall_aliases_import.php
View file @
f21708cb
...
@@ -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'
]
<>
""
)
{
...
...
src/www/firewall_nat_out_edit.php
View file @
f21708cb
...
@@ -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'
]))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment