Commit d39f0ce4 authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-934 Use is_resource() to check the stream, check if categories are

set before intersecting.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 8cabbd51
......@@ -2459,7 +2459,7 @@ class MAPIProvider {
$addrbook = $this->getAddressbook();
$stream = mapi_inetmapi_imtoinet($this->session, $addrbook, $mapimessage, array('use_tnef' => -1));
if (isset($stream)) {
if (is_resource($stream)) {
$mstreamstat = mapi_stream_stat($stream);
$streamsize = $mstreamstat["cb"];
if (isset($streamsize)) {
......
......@@ -127,11 +127,13 @@ class SyncNote extends SyncObject {
// is a color other than yellow set
if (isset($this->Color) && $this->Color != 3 && $this->Color > -1 && $this->Color < 5) {
// check existing categories - do not rewrite category if the category is already a supported or unsupported color
if (!empty($this->categories)) {
$insecUnsupp = array_intersect($this->categories, array_values(self::$unsupportedColors));
$insecColors = array_intersect($this->categories, array_values(self::$colors));
if (!empty($this->categories) && (!empty($insecUnsupp) || !empty($insecColors))) {
if (!empty($insecUnsupp) || !empty($insecColors)) {
return false;
}
}
if(!isset($this->categories)) {
$this->categories = array();
}
......
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