Skip to content

Commit

Permalink
Revert "[mms] Don't clone objects when returning data from the struct…
Browse files Browse the repository at this point in the history
…ure object."

This reverts commit e3e7fcd.

This is not correct, since we want the data stored in the cache to be
pristine.

See Bug #13700
  • Loading branch information
slusarz committed Nov 18, 2014
1 parent 0ffc4bc commit af0d2fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 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])
? $this->_data[Horde_Imap_Client::FETCH_STRUCTURE]
? clone $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])
? $this->_data[Horde_Imap_Client::FETCH_ENVELOPE]
? clone $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])
? $this->_data[Horde_Imap_Client::FETCH_IMAPDATE]
? clone $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 $this->_data[$key][$id];
return clone $this->_data[$key][$id];
}
return Horde_Mime_Headers::parseHeaders($this->_getHeaders($id, self::HEADER_STREAM, $key));
}
Expand Down
2 changes: 0 additions & 2 deletions framework/Imap_Client/package.xml
Expand Up @@ -21,7 +21,6 @@
</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 @@ -2757,7 +2756,6 @@
<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 af0d2fe

Please sign in to comment.