summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Beaver <sbeaver@netgate.com>2016-11-08 13:50:39 -0500
committerSteve Beaver <sbeaver@netgate.com>2016-11-08 13:53:46 -0500
commite5f9360fc81089225e46f55078699a7d21f3e9ce (patch)
tree365d1d8edeab870cbb0365309af6064f7f4c100f
parent4c7ec3debd32c5808c9e517e51a9306255ab1bd9 (diff)
downloadpfsense-e5f9360fc81089225e46f55078699a7d21f3e9ce.zip
pfsense-e5f9360fc81089225e46f55078699a7d21f3e9ce.tar.gz
Fixed #6893
Null configuration settings are now written as <tag></tag> instead of <tag /> for consistency
-rw-r--r--src/etc/inc/xmlparse.inc8
-rw-r--r--src/etc/inc/xmlreader.inc14
2 files changed, 14 insertions, 8 deletions
diff --git a/src/etc/inc/xmlparse.inc b/src/etc/inc/xmlparse.inc
index 837d858..84a1424 100644
--- a/src/etc/inc/xmlparse.inc
+++ b/src/etc/inc/xmlparse.inc
@@ -258,7 +258,7 @@ function dump_xml_config_sub($arr, $indent) {
if (is_array($cval)) {
if (empty($cval)) {
$xmlconfig .= str_repeat("\t", $indent);
- $xmlconfig .= "<$ent/>\n";
+ $xmlconfig .= "<$ent></$ent>\n";
} else {
$xmlconfig .= str_repeat("\t", $indent);
$xmlconfig .= "<$ent>\n";
@@ -272,7 +272,7 @@ function dump_xml_config_sub($arr, $indent) {
}
$xmlconfig .= str_repeat("\t", $indent);
if ((is_bool($cval) && $cval == true) || ($cval === "")) {
- $xmlconfig .= "<$ent/>\n";
+ $xmlconfig .= "<$ent></$ent>\n";
} else if ((substr($ent, 0, 5) == "descr") ||
(substr($ent, 0, 6) == "detail") ||
(substr($ent, 0, 12) == "login_banner") ||
@@ -289,7 +289,7 @@ function dump_xml_config_sub($arr, $indent) {
}
} else if (empty($val)) {
$xmlconfig .= str_repeat("\t", $indent);
- $xmlconfig .= "<$ent/>\n";
+ $xmlconfig .= "<$ent></$ent>\n";
} else {
/* it's an array */
$xmlconfig .= str_repeat("\t", $indent);
@@ -301,7 +301,7 @@ function dump_xml_config_sub($arr, $indent) {
} else {
if ((is_bool($val) && ($val == true)) || ($val === "")) {
$xmlconfig .= str_repeat("\t", $indent);
- $xmlconfig .= "<$ent/>\n";
+ $xmlconfig .= "<$ent></$ent>\n";
} else if (!is_bool($val)) {
$xmlconfig .= str_repeat("\t", $indent);
if ((substr($ent, 0, 5) == "descr") ||
diff --git a/src/etc/inc/xmlreader.inc b/src/etc/inc/xmlreader.inc
index 15a8dbb..684f7bc 100644
--- a/src/etc/inc/xmlreader.inc
+++ b/src/etc/inc/xmlreader.inc
@@ -219,7 +219,8 @@ function dump_xml_config_sub(& $writer, $arr) {
foreach ($val as $cval) {
if (is_array($cval)) {
if (empty($cval)) {
- $writer->writeElement($ent);
+ $writer->startElement($ent);
+ $writer->endElement();
} else {
$writer->startElement($ent);
dump_xml_config_sub($writer, $cval);
@@ -230,14 +231,16 @@ function dump_xml_config_sub(& $writer, $arr) {
continue;
}
if ((is_bool($val) && ($val == true)) || ($val === "")) {
- $writer->writeElement($ent);
+ $writer->startElement($ent);
+ $writer->endElement();
} else if (!is_bool($val)) {
$writer->writeElement($ent, $cval);
}
}
}
} else if (empty($val)) {
- $writer->writeElement($ent);
+ $writer->startElement($ent);
+ $writer->endElement();
} else {
/* it's an array */
$writer->startElement($ent);
@@ -246,7 +249,8 @@ function dump_xml_config_sub(& $writer, $arr) {
}
} else {
if ((is_bool($val) && ($val == true)) || ($val === "")) {
- $writer->writeElement($ent);
+ $writer->startElement($ent);
+ $writer->endElement();
} else if (!is_bool($val)) {
$writer->writeElement($ent, $val);
}
@@ -263,6 +267,8 @@ function dump_xml_config($arr, $rootobj) {
$listtags[$tag] = $tag;
}
}
+
+
return dump_xml_config_raw($arr, $rootobj);
}
OpenPOWER on IntegriCloud