summaryrefslogtreecommitdiff
path: root/lib/util.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-07-08 19:32:18 -0400
committerEvan Prodromou <evan@prodromou.name>2008-07-08 19:32:18 -0400
commit91af9de7e4e477da422880fe9b7f3a49617dc77e (patch)
treea4beceae39f33e8f3471f6cbbd5a74b8873ff3ff /lib/util.php
parentca4fed34b53375a16748787d36df4e7cc7341732 (diff)
don't do an end tag for empty elements
darcs-hash:20080708233218-84dde-45850157b8fce2ac1d5c1d16a4fdb4fbcc817b76.gz
Diffstat (limited to 'lib/util.php')
-rw-r--r--lib/util.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/util.php b/lib/util.php
index d08e9d54b..8f357e19f 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -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) {