]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
don't call text if you don't mean it
authorEvan Prodromou <evan@prodromou.name>
Tue, 8 Jul 2008 23:50:04 +0000 (19:50 -0400)
committerEvan Prodromou <evan@prodromou.name>
Tue, 8 Jul 2008 23:50:04 +0000 (19:50 -0400)
darcs-hash:20080708235004-84dde-bca47ff45828387ed256195ef5cf9051f99a5163.gz

lib/util.php

index 8f357e19f1e2b9587bbf53b197dcb8ff19680d3d..2e2a78051e85fdc8953fd197ff1b26d255d131dd 100644 (file)
@@ -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) {