diff --git a/mail/inc/class.mail_zpush.inc.php b/mail/inc/class.mail_zpush.inc.php index 7c0e4330d9..93a1a44bbc 100644 --- a/mail/inc/class.mail_zpush.inc.php +++ b/mail/inc/class.mail_zpush.inc.php @@ -904,7 +904,7 @@ class mail_zpush implements activesync_plugin_write, activesync_plugin_sendmail, } ZLog::Write(LOGLEVEL_DEBUG,__METHOD__.__LINE__." getBodyPreferenceBestMatch: ".array2string($bpReturnType)); // set the protocoll class - $output->asbody = new SyncBaseBodyCloseStream(); + $output->asbody = new SyncBaseBody(); // return full mime-message without any (charset) conversation directly as stream if ($bpReturnType==SYNC_BODYPREFERENCE_MIME) @@ -1253,7 +1253,7 @@ class mail_zpush implements activesync_plugin_write, activesync_plugin_sendmail, $this->mail->reopen($folder); $attachment = $this->mail->getAttachment($id,$part,0,false,true,$folder); - $SIOattachment = new SyncItemOperationsAttachmentCloseStream(); + $SIOattachment = new SyncItemOperationsAttachment(); fseek($attachment['attachment'], 0, SEEK_SET); // z-push requires stream seeked to start $SIOattachment->data = $attachment['attachment']; //ZLog::Write(LOGLEVEL_DEBUG,__METHOD__.": $fid (attname: '$attname') Data:".$attachment['attachment']); @@ -2083,25 +2083,3 @@ class mail_zpush implements activesync_plugin_write, activesync_plugin_sendmail, return $dir.'/'.$dev_id.'.hashes'; } } - -/** - * Extend SyncBaseBody to close streams on destruction to free memory - */ -class SyncBaseBodyCloseStream extends SyncBaseBody -{ - function __destruct() - { - if (is_resource($this->data)) fclose($this->data); - } -} - -/** - * Extend SyncItemOperationsAttachment to close streams on destruction to free memory - */ -class SyncItemOperationsAttachmentCloseStream extends SyncItemOperationsAttachment -{ - function __destruct() - { - if (is_resource($this->data)) fclose($this->data); - } -} \ No newline at end of file