Skip to content

Commit

Permalink
[mms] Don't clone objects when returning data from the structure object.
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Nov 17, 2014
1 parent 3e7adbf commit e3e7fcd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions framework/Imap_Client/lib/Horde/Imap/Client/Data/Fetch.php
Expand Up @@ -75,7 +75,7 @@ public function setStructure(Horde_Mime_Part $structure)
public function getStructure()
{
return isset($this->_data[Horde_Imap_Client::FETCH_STRUCTURE])
? clone $this->_data[Horde_Imap_Client::FETCH_STRUCTURE]
? $this->_data[Horde_Imap_Client::FETCH_STRUCTURE]
: new Horde_Mime_Part();
}

Expand Down Expand Up @@ -275,7 +275,7 @@ public function setEnvelope($data)
public function getEnvelope()
{
return isset($this->_data[Horde_Imap_Client::FETCH_ENVELOPE])
? clone $this->_data[Horde_Imap_Client::FETCH_ENVELOPE]
? $this->_data[Horde_Imap_Client::FETCH_ENVELOPE]
: new Horde_Imap_Client_Data_Envelope();
}

Expand Down Expand Up @@ -322,7 +322,7 @@ public function setImapDate($date)
public function getImapDate()
{
return isset($this->_data[Horde_Imap_Client::FETCH_IMAPDATE])
? clone $this->_data[Horde_Imap_Client::FETCH_IMAPDATE]
? $this->_data[Horde_Imap_Client::FETCH_IMAPDATE]
: new Horde_Imap_Client_DateTime();
}

Expand Down Expand Up @@ -550,7 +550,7 @@ protected function _getHeaders($id, $format, $key)
if (!isset($this->_data[$key][$id])) {
return new Horde_Mime_Headers();
} elseif (is_object($this->_data[$key][$id])) {
return clone $this->_data[$key][$id];
return $this->_data[$key][$id];
}
return Horde_Mime_Headers::parseHeaders($this->_getHeaders($id, self::HEADER_STREAM, $key));
}
Expand Down
2 changes: 2 additions & 0 deletions framework/Imap_Client/package.xml
Expand Up @@ -21,6 +21,7 @@
</stability>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [mms] Don&apos;t clone objects when returning data from the structure object.
* [mms] Better error handling when IMAP connection is prematurely disconnected.
* [mms] Fix regression in listMailboxes() for POP3 servers when &apos;flat&apos; option is true.
</notes>
Expand Down Expand Up @@ -2756,6 +2757,7 @@
<date>2014-11-10</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [mms] Don&apos;t clone objects when returning data from the structure object.
* [mms] Better error handling when IMAP connection is prematurely disconnected.
* [mms] Fix regression in listMailboxes() for POP3 servers when &apos;flat&apos; option is true.
</notes>
Expand Down

0 comments on commit e3e7fcd

Please sign in to comment.