]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
don't do an end tag for empty elements
authorEvan Prodromou <evan@prodromou.name>
Tue, 8 Jul 2008 23:32:18 +0000 (19:32 -0400)
committerEvan Prodromou <evan@prodromou.name>
Tue, 8 Jul 2008 23:32:18 +0000 (19:32 -0400)
darcs-hash:20080708233218-84dde-45850157b8fce2ac1d5c1d16a4fdb4fbcc817b76.gz

lib/util.php

index d08e9d54b78232b8099a57ddfbc6b4a136c5b991..8f357e19f1e2b9587bbf53b197dcb8ff19680d3d 100644 (file)
@@ -93,9 +93,16 @@ function common_element_start($tag, $attrs=NULL) {
 }
 
 function common_element_end($tag) {
+       static $empty_tag = array('base', 'meta', 'link', 'hr',
+                                                         'br', 'param', 'img', 'area',
+                                                         'input', 'col'); 
        global $xw;
-       # TODO: switch based on $tag
-       $xw->fullEndElement();
+       # TODO check namespace
+       if (in_array($tag, $empty_tag)) {
+               $xw->endElement();
+       } else {
+               $xw->fullEndElement();
+       }
 }
 
 function common_element($tag, $attrs=NULL, $content=NULL) {