From f98dd41aaa73d50371bbf6e80d26f0a322b90dbd Mon Sep 17 00:00:00 2001 From: dairiki Date: Sun, 27 Jan 2002 22:06:38 +0000 Subject: [PATCH] Fix/add isEmpty() methods of XmlElement and RawXml. git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@1620 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/XmlElement.php | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/lib/XmlElement.php b/lib/XmlElement.php index f58501c23..18ce09cf9 100644 --- a/lib/XmlElement.php +++ b/lib/XmlElement.php @@ -1,4 +1,4 @@ -_content); + if (empty($this->_content)) + return true; + foreach ($this->_content as $x) { + if (!empty($x)) + return false; + } + return true; } function hasInlineContent () { @@ -196,6 +212,10 @@ class RawXml { function asXML () { return $this->_xml; } + + function isEmpty () { + return empty($this->_xml); + } } class FormattedText { -- 2.45.0