Skip to content

Commit

Permalink
Fix returning header stream data when stored value is a Headers object
Browse files Browse the repository at this point in the history
caught by new unit tests
  • Loading branch information
slusarz committed Jan 23, 2015
1 parent ebda88c commit f13aa1b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions framework/Imap_Client/lib/Horde/Imap/Client/Data/Fetch.php
Expand Up @@ -568,11 +568,14 @@ protected function _getHeaders($id, $format, $key)
switch ($format) {
case self::HEADER_STREAM:
if (!isset($this->_data[$key][$id])) {
return $this->_msgText(true, null);
$data = null;
} elseif (is_object($this->_data[$key][$id])) {
return $this->_getHeaders($id, 0, $key);
$data = $this->_getHeaders($id, 0, $key);
} else {
$data = $this->_data[$key][$id];
}
return $this->_msgText(true, $this->_data[$key][$id]);

return $this->_msgText(true, $data);

case self::HEADER_PARSE:
if (!isset($this->_data[$key][$id])) {
Expand Down

0 comments on commit f13aa1b

Please sign in to comment.