From 0d57f5f37cf8b8d8d53ccb6cbe291c7a732d657a Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Tue, 18 Oct 2005 19:50:10 +0000 Subject: 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. --- etc/inc/xmlparse.inc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'etc') 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 .= "\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) . "\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 +?> -- cgit v1.1