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
77d651cc
Commit
77d651cc
authored
Mar 13, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix config->toArray
parent
bab9a4c1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
Config.php
src/opnsense/mvc/app/library/OPNsense/Core/Config.php
+6
-4
No files found.
src/opnsense/mvc/app/library/OPNsense/Core/Config.php
View file @
77d651cc
...
...
@@ -85,14 +85,16 @@ class Config extends Singleton
$tmpNode
=
$this
->
toArray
(
$forceList
,
$xmlNode
);
if
(
array_key_exists
(
$xmlNode
->
getName
(),
$result
))
{
$old_content
=
$result
[
$xmlNode
->
getName
()];
// check if array content is associative, if move items to list
if
(
array_keys
(
$old_content
)
!==
range
(
0
,
count
(
$old_content
)
-
1
)
||
(
is_array
(
$forceList
)
&&
array_key_exists
(
$xmlNode
->
getName
(),
$forceList
))
)
{
// check if array content is associative, move items to list
if
(
array_keys
(
$old_content
)
!==
range
(
0
,
count
(
$old_content
)
-
1
))
{
$result
[
$xmlNode
->
getName
()]
=
array
();
$result
[
$xmlNode
->
getName
()][]
=
$old_content
;
}
$result
[
$xmlNode
->
getName
()][]
=
$tmpNode
;
}
elseif
(
is_array
(
$forceList
)
&&
array_key_exists
(
$xmlNode
->
getName
(),
$forceList
))
{
// force tag in an array
$result
[
$xmlNode
->
getName
()]
=
array
();
$result
[
$xmlNode
->
getName
()][]
=
$tmpNode
;
}
else
{
$result
[
$xmlNode
->
getName
()]
=
$tmpNode
;
}
...
...
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