Commit 6fca8655 authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #217 in ZP/z-push from bugfix/ZP-843-mapi-stream-warnings to develop

* commit 'ea4c8049':
  ZP-843 Fixed warnings that $stream was boolean instead of ressource.
parents 677442d5 ea4c8049
...@@ -2458,28 +2458,28 @@ class MAPIProvider { ...@@ -2458,28 +2458,28 @@ class MAPIProvider {
if (function_exists("mapi_inetmapi_imtoinet")) { if (function_exists("mapi_inetmapi_imtoinet")) {
$addrbook = $this->getAddressbook(); $addrbook = $this->getAddressbook();
$stream = mapi_inetmapi_imtoinet($this->session, $addrbook, $mapimessage, array('use_tnef' => -1)); $stream = mapi_inetmapi_imtoinet($this->session, $addrbook, $mapimessage, array('use_tnef' => -1));
$mstreamstat = mapi_stream_stat($stream);
$streamsize = $mstreamstat["cb"];
if (isset($stream) && isset($streamsize)) { if (isset($stream)) {
if (Request::GetProtocolVersion() >= 12.0) { $mstreamstat = mapi_stream_stat($stream);
if (!isset($message->asbody)) $streamsize = $mstreamstat["cb"];
$message->asbody = new SyncBaseBody(); if (isset($streamsize)) {
$message->asbody->data = MAPIStreamWrapper::Open($stream); if (Request::GetProtocolVersion() >= 12.0) {
$message->asbody->estimatedDataSize = $streamsize; if (!isset($message->asbody))
$message->asbody->truncated = 0; $message->asbody = new SyncBaseBody();
} $message->asbody->data = MAPIStreamWrapper::Open($stream);
else { $message->asbody->estimatedDataSize = $streamsize;
$message->mimedata = MAPIStreamWrapper::Open($stream); $message->asbody->truncated = 0;
$message->mimesize = $streamsize; }
$message->mimetruncated = 0; else {
$message->mimedata = MAPIStreamWrapper::Open($stream);
$message->mimesize = $streamsize;
$message->mimetruncated = 0;
}
unset($message->body, $message->bodytruncated);
return true;
} }
unset($message->body, $message->bodytruncated);
return true;
}
else {
ZLog::Write(LOGLEVEL_ERROR, sprintf("MAPIProvider->imtoinet(): got no stream or content from mapi_inetmapi_imtoinet()"));
} }
ZLog::Write(LOGLEVEL_ERROR, sprintf("MAPIProvider->imtoinet(): got no stream or content from mapi_inetmapi_imtoinet()"));
} }
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment