From af0d2fe1b82799a99ac832a0e1278b7e8dd219b9 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 18 Nov 2014 13:47:15 -0700 Subject: [PATCH] Revert "[mms] Don't clone objects when returning data from the structure object." This reverts commit e3e7fcdacbf34a6863474a5426d0a661e3ee952e. This is not correct, since we want the data stored in the cache to be pristine. See Bug #13700 --- .../Imap_Client/lib/Horde/Imap/Client/Data/Fetch.php | 8 ++++---- framework/Imap_Client/package.xml | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/framework/Imap_Client/lib/Horde/Imap/Client/Data/Fetch.php b/framework/Imap_Client/lib/Horde/Imap/Client/Data/Fetch.php index 593ce6db21c..7a697bd84e7 100644 --- a/framework/Imap_Client/lib/Horde/Imap/Client/Data/Fetch.php +++ b/framework/Imap_Client/lib/Horde/Imap/Client/Data/Fetch.php @@ -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(); } @@ -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(); } @@ -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(); } @@ -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)); } diff --git a/framework/Imap_Client/package.xml b/framework/Imap_Client/package.xml index acb990f44c1..7595e325bf8 100644 --- a/framework/Imap_Client/package.xml +++ b/framework/Imap_Client/package.xml @@ -21,7 +21,6 @@ LGPL-2.1 -* [mms] Don'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 'flat' option is true. @@ -2757,7 +2756,6 @@ 2014-11-10 LGPL-2.1 -* [mms] Don'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 'flat' option is true.