diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-10-18 19:50:10 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-10-18 19:50:10 +0000 |
commit | 0d57f5f37cf8b8d8d53ccb6cbe291c7a732d657a (patch) | |
tree | c32c219522c561fb1f517c78b8495a4c69b3e2e9 /etc/inc | |
parent | 42a58cb914e02d4f1fccdd348a030f30c77a040d (diff) | |
download | pfsense-0d57f5f37cf8b8d8d53ccb6cbe291c7a732d657a.zip pfsense-0d57f5f37cf8b8d8d53ccb6cbe291c7a732d657a.tar.gz |
If a value is marked as "false" simply do not write its contents out.
This will fix 71 occurances of true : false in the code w/o having
to touch each case. And frankly, a item should not be in the xml
unless its set.
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/xmlparse.inc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/etc/inc/xmlparse.inc b/etc/inc/xmlparse.inc index 631cb9f..7068288 100644 --- a/etc/inc/xmlparse.inc +++ b/etc/inc/xmlparse.inc @@ -184,13 +184,14 @@ function dump_xml_config_sub($arr, $indent) { $xmlconfig .= "</$ent>\n"; } else { $xmlconfig .= str_repeat("\t", $indent); - if ((is_bool($cval) && ($cval == true)) || - ($cval === "")) + if($cval === false) continue; + if(($cval === true) || ($cval === "")) { $xmlconfig .= "<$ent/>\n"; - else if (!is_bool($cval)) + } else { $xmlconfig .= "<$ent>" . htmlspecialchars($cval) . "</$ent>\n"; } } + } } else { /* it's an array */ $xmlconfig .= str_repeat("\t", $indent); @@ -237,4 +238,4 @@ function dump_xml_config_raw($arr, $rootobj) { return $xmlconfig; } -?>
\ No newline at end of file +?> |