summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-07-08 19:50:04 -0400
committerEvan Prodromou <evan@prodromou.name>2008-07-08 19:50:04 -0400
commit485314fe20cf09fa8d5b354f4d143b0f4b1e40a3 (patch)
treef0e5bffd26f050959100046865281c60e9377145
parent91af9de7e4e477da422880fe9b7f3a49617dc77e (diff)
don't call text if you don't mean it
darcs-hash:20080708235004-84dde-bca47ff45828387ed256195ef5cf9051f99a5163.gz
-rw-r--r--lib/util.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/util.php b/lib/util.php
index 8f357e19f..2e2a78051 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -97,7 +97,7 @@ function common_element_end($tag) {
'br', 'param', 'img', 'area',
'input', 'col');
global $xw;
- # TODO check namespace
+ # XXX: check namespace
if (in_array($tag, $empty_tag)) {
$xw->endElement();
} else {
@@ -106,10 +106,12 @@ function common_element_end($tag) {
}
function common_element($tag, $attrs=NULL, $content=NULL) {
- common_element_start($tag, $attrs);
- global $xw;
- $xw->text($content);
- common_element_end($tag);
+ common_element_start($tag, $attrs);
+ global $xw;
+ if ($content) {
+ $xw->text($content);
+ }
+ common_element_end($tag);
}
function common_start_xml($doc=NULL, $public=NULL, $system=NULL) {