From: Michael J. Rubinsky Date: Thu, 3 Jun 2010 17:22:20 +0000 (-0400) Subject: Force output of bodytruncated tag if it's empty. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=1e472b176ca43ca4b291281429482279787a4e4d;p=horde.git Force output of bodytruncated tag if it's empty. --- diff --git a/framework/ActiveSync/lib/Horde/ActiveSync/Message/Base.php b/framework/ActiveSync/lib/Horde/ActiveSync/Message/Base.php index 072d0dba3..bdf4e06b4 100644 --- a/framework/ActiveSync/lib/Horde/ActiveSync/Message/Base.php +++ b/framework/ActiveSync/lib/Horde/ActiveSync/Message/Base.php @@ -133,7 +133,7 @@ class Horde_ActiveSync_Message_Base public function __isset($property) { - return !empty($this->_properties[$property]); + return isset($this->_properties[$property]); } /** @@ -327,9 +327,12 @@ class Horde_ActiveSync_Message_Base } else { /* Simple type */ if (strlen($this->$map[self::KEY_ATTRIBUTE]) == 0) { - // Do not output empty items. - // See above: $encoder->startTag($tag, false, true); - continue; + // Do not output empty items except for the following: + if ($this->_checkSendEmpty($tag)) { + $encoder->startTag($tag, false, true); + } else { + continue; + } } else { $encoder->startTag($tag); } @@ -351,6 +354,18 @@ class Horde_ActiveSync_Message_Base } /** + * Checks to see if we should send an empty value. + * + * @param string $tag The tag name + * + * @return boolean + */ + protected function _checkSendEmpty($tag) + { + return false; + } + + /** * * @param $message * @return unknown_type diff --git a/framework/ActiveSync/lib/Horde/ActiveSync/Message/Contact.php b/framework/ActiveSync/lib/Horde/ActiveSync/Message/Contact.php index 4476dbca4..07c700c52 100644 --- a/framework/ActiveSync/lib/Horde/ActiveSync/Message/Contact.php +++ b/framework/ActiveSync/lib/Horde/ActiveSync/Message/Contact.php @@ -246,4 +246,13 @@ class Horde_ActiveSync_Message_Contact extends Horde_ActiveSync_Message_Base return 'Contacts'; } + protected function _checkSendEmpty($tag) + { + if ($tag == self::BODYTRUNCATED && $this->bodysize > 0) { + return true; + } + + return false; + } + }