@@ -114,7 +114,7 @@ |
||
| 114 | 114 | * @param mixed $message |
| 115 | 115 | */ |
| 116 | 116 | protected function afterLog($loglevel, $message) { |
| 117 | - if ($loglevel & (LOGLEVEL_FATAL | LOGLEVEL_ERROR | LOGLEVEL_WARN)) { |
|
| 117 | + if ($loglevel & (LOGLEVEL_FATAL|LOGLEVEL_ERROR|LOGLEVEL_WARN)) { |
|
| 118 | 118 | $data = $this->BuildLogString($loglevel, $message) . PHP_EOL; |
| 119 | 119 | @file_put_contents(LOGERRORFILE, $data, FILE_APPEND); |
| 120 | 120 | } |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | */ |
| 53 | 53 | public function SetPort($value) { |
| 54 | 54 | if (is_numeric($value)) { |
| 55 | - $this->port = (int) $value; |
|
| 55 | + $this->port = (int)$value; |
|
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | |
@@ -1372,8 +1372,7 @@ discard block |
||
| 1372 | 1372 | |
| 1373 | 1373 | // if the search range is set limit the result to it, otherwise return all found messages |
| 1374 | 1374 | $rows = (is_array($searchRange) && isset($searchRange[0], $searchRange[1])) ? |
| 1375 | - mapi_table_queryrows($table, [PR_ENTRYID], $searchRange[0], $searchRange[1] - $searchRange[0] + 1) : |
|
| 1376 | - mapi_table_queryrows($table, [PR_ENTRYID], 0, SEARCH_MAXRESULTS); |
|
| 1375 | + mapi_table_queryrows($table, [PR_ENTRYID], $searchRange[0], $searchRange[1] - $searchRange[0] + 1) : mapi_table_queryrows($table, [PR_ENTRYID], 0, SEARCH_MAXRESULTS); |
|
| 1377 | 1376 | |
| 1378 | 1377 | $cnt = count($rows); |
| 1379 | 1378 | $items['searchtotal'] = $cnt; |
@@ -1977,12 +1976,12 @@ discard block |
||
| 1977 | 1976 | mapi_setprops($stateMessage, [PR_DISPLAY_NAME => $messageName, PR_MESSAGE_CLASS => 'IPM.Note.GrommunioState']); |
| 1978 | 1977 | } |
| 1979 | 1978 | if (isset($stateMessage)) { |
| 1980 | - $jsonEncodedState = is_object($state) || is_array($state) ? json_encode($state, JSON_INVALID_UTF8_IGNORE | JSON_UNESCAPED_UNICODE) : $state; |
|
| 1979 | + $jsonEncodedState = is_object($state) || is_array($state) ? json_encode($state, JSON_INVALID_UTF8_IGNORE|JSON_UNESCAPED_UNICODE) : $state; |
|
| 1981 | 1980 | |
| 1982 | 1981 | $encodedState = base64_encode($jsonEncodedState); |
| 1983 | 1982 | $encodedStateLength = strlen($encodedState); |
| 1984 | 1983 | mapi_setprops($stateMessage, [PR_LAST_VERB_EXECUTED => is_int($counter) ? $counter : 0]); |
| 1985 | - $stream = mapi_openproperty($stateMessage, PR_BODY, IID_IStream, STGM_DIRECT, MAPI_CREATE | MAPI_MODIFY); |
|
| 1984 | + $stream = mapi_openproperty($stateMessage, PR_BODY, IID_IStream, STGM_DIRECT, MAPI_CREATE|MAPI_MODIFY); |
|
| 1986 | 1985 | mapi_stream_setsize($stream, $encodedStateLength); |
| 1987 | 1986 | mapi_stream_write($stream, $encodedState); |
| 1988 | 1987 | mapi_stream_commit($stream); |
@@ -2077,7 +2076,7 @@ discard block |
||
| 2077 | 2076 | private function adviseStoreToSink($store) { |
| 2078 | 2077 | // check if we already advised the store |
| 2079 | 2078 | if (!in_array($store, $this->changesSinkStores)) { |
| 2080 | - mapi_msgstore_advise($store, null, fnevObjectModified | fnevObjectCreated | fnevObjectMoved | fnevObjectDeleted, $this->changesSink); |
|
| 2079 | + mapi_msgstore_advise($store, null, fnevObjectModified|fnevObjectCreated|fnevObjectMoved|fnevObjectDeleted, $this->changesSink); |
|
| 2081 | 2080 | |
| 2082 | 2081 | if (mapi_last_hresult()) { |
| 2083 | 2082 | SLog::Write(LOGLEVEL_WARN, sprintf("Grommunio->adviseStoreToSink(): failed to advised store '%s' with code 0x%X. Polling will be performed.", $store, mapi_last_hresult())); |
@@ -2551,7 +2550,7 @@ discard block |
||
| 2551 | 2550 | $resOr, |
| 2552 | 2551 | [RES_CONTENT, |
| 2553 | 2552 | [ |
| 2554 | - FUZZYLEVEL => FL_SUBSTRING | FL_IGNORECASE, |
|
| 2553 | + FUZZYLEVEL => FL_SUBSTRING|FL_IGNORECASE, |
|
| 2555 | 2554 | ULPROPTAG => $property, |
| 2556 | 2555 | VALUE => u2w($term), |
| 2557 | 2556 | ], |
@@ -462,7 +462,7 @@ discard block |
||
| 462 | 462 | switch ($recurrence->recur["type"]) { |
| 463 | 463 | case 10: |
| 464 | 464 | if ($recurrence->recur["subtype"] == 0) { |
| 465 | - $syncRecurrence->interval = (int) ($recurrence->recur["everyn"] / 1440); |
|
| 465 | + $syncRecurrence->interval = (int)($recurrence->recur["everyn"] / 1440); |
|
| 466 | 466 | } // minutes |
| 467 | 467 | break; |
| 468 | 468 | |
@@ -472,7 +472,7 @@ discard block |
||
| 472 | 472 | break; // months / weeks |
| 473 | 473 | |
| 474 | 474 | case 13: |
| 475 | - $syncRecurrence->interval = (int) ($recurrence->recur["everyn"] / 12); |
|
| 475 | + $syncRecurrence->interval = (int)($recurrence->recur["everyn"] / 12); |
|
| 476 | 476 | break; // months |
| 477 | 477 | } |
| 478 | 478 | |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | $syncRecurrence->weekofmonth = $recurrence->recur["nday"]; |
| 484 | 484 | } // N'th {DAY} of {X} (0-5) |
| 485 | 485 | if (isset($recurrence->recur["month"])) { |
| 486 | - $syncRecurrence->monthofyear = (int) ($recurrence->recur["month"] / (60 * 24 * 29)) + 1; |
|
| 486 | + $syncRecurrence->monthofyear = (int)($recurrence->recur["month"] / (60 * 24 * 29)) + 1; |
|
| 487 | 487 | } // works ok due to rounding. see also $monthminutes below (1-12) |
| 488 | 488 | if (isset($recurrence->recur["monthday"])) { |
| 489 | 489 | $syncRecurrence->dayofmonth = $recurrence->recur["monthday"]; |
@@ -1540,8 +1540,7 @@ discard block |
||
| 1540 | 1540 | if (isset($exception->asbody)) { |
| 1541 | 1541 | $this->setASbody($exception->asbody, $exceptionprops, $appointmentprops); |
| 1542 | 1542 | $mapiexception["body"] = $exceptionprops[$appointmentprops["body"]] = |
| 1543 | - (isset($exceptionprops[$appointmentprops["body"]])) ? $exceptionprops[$appointmentprops["body"]] : |
|
| 1544 | - ((isset($exceptionprops[$appointmentprops["html"]])) ? $exceptionprops[$appointmentprops["html"]] : ""); |
|
| 1543 | + (isset($exceptionprops[$appointmentprops["body"]])) ? $exceptionprops[$appointmentprops["body"]] : ((isset($exceptionprops[$appointmentprops["html"]])) ? $exceptionprops[$appointmentprops["html"]] : ""); |
|
| 1545 | 1544 | } |
| 1546 | 1545 | |
| 1547 | 1546 | array_push($recur["changed_occurrences"], $mapiexception); |
@@ -1616,7 +1615,7 @@ discard block |
||
| 1616 | 1615 | $org[PR_ADDRTYPE] = isset($representingprops[$appointmentprops["sentrepresentingaddt"]]) ? $representingprops[$appointmentprops["sentrepresentingaddt"]] : $props[$appointmentprops["sentrepresentingaddt"]]; |
| 1617 | 1616 | $org[PR_SMTP_ADDRESS] = $org[PR_EMAIL_ADDRESS] = isset($representingprops[$appointmentprops["sentrepresentingemail"]]) ? $representingprops[$appointmentprops["sentrepresentingemail"]] : $props[$appointmentprops["sentrepresentingemail"]]; |
| 1618 | 1617 | $org[PR_SEARCH_KEY] = isset($representingprops[$appointmentprops["sentrepresentinsrchk"]]) ? $representingprops[$appointmentprops["sentrepresentinsrchk"]] : $props[$appointmentprops["sentrepresentinsrchk"]]; |
| 1619 | - $org[PR_RECIPIENT_FLAGS] = recipOrganizer | recipSendable; |
|
| 1618 | + $org[PR_RECIPIENT_FLAGS] = recipOrganizer|recipSendable; |
|
| 1620 | 1619 | $org[PR_RECIPIENT_TYPE] = MAPI_ORIG; |
| 1621 | 1620 | |
| 1622 | 1621 | array_push($recips, $org); |
@@ -2494,7 +2493,7 @@ discard block |
||
| 2494 | 2493 | $props[$properties["emailaddresstype{$cnt}"]] = "SMTP"; |
| 2495 | 2494 | $props[$properties["emailaddressentryid{$cnt}"]] = mapi_createoneoff($name, "SMTP", $emailAddress); |
| 2496 | 2495 | $nremails[] = $cnt - 1; |
| 2497 | - $abprovidertype |= 2 ^ ($cnt - 1); |
|
| 2496 | + $abprovidertype |= 2^($cnt - 1); |
|
| 2498 | 2497 | } |
| 2499 | 2498 | } |
| 2500 | 2499 | |
@@ -249,7 +249,7 @@ |
||
| 249 | 249 | if (self::$decoder->getElementStartTag(SYNC_ITEMOPERATIONS_DELETESUBFOLDERS)) { |
| 250 | 250 | $operation['deletesubfolders'] = true; |
| 251 | 251 | if (($dsf = self::$decoder->getElementContent()) !== false) { |
| 252 | - $operation['deletesubfolders'] = (bool) $dsf; |
|
| 252 | + $operation['deletesubfolders'] = (bool)$dsf; |
|
| 253 | 253 | if (!self::$decoder->getElementEndTag()) { |
| 254 | 254 | return false; |
| 255 | 255 | } |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | elseif (self::$decoder->getElementStartTag(SYNC_CONVERSATIONMODE)) { |
| 62 | 62 | $spa->SetConversationMode(true); |
| 63 | 63 | if (($conversationmode = self::$decoder->getElementContent()) !== false) { |
| 64 | - $spa->SetConversationMode((bool) $conversationmode); |
|
| 64 | + $spa->SetConversationMode((bool)$conversationmode); |
|
| 65 | 65 | if (!self::$decoder->getElementEndTag()) { |
| 66 | 66 | return false; |
| 67 | 67 | } |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | if (self::$decoder->getElementStartTag(SYNC_DELETESASMOVES)) { |
| 207 | 207 | $spa->SetDeletesAsMoves(true); |
| 208 | 208 | if (($dam = self::$decoder->getElementContent()) !== false) { |
| 209 | - $spa->SetDeletesAsMoves((bool) $dam); |
|
| 209 | + $spa->SetDeletesAsMoves((bool)$dam); |
|
| 210 | 210 | if (!self::$decoder->getElementEndTag()) { |
| 211 | 211 | return false; |
| 212 | 212 | } |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | if (self::$decoder->getElementStartTag(SYNC_CONVERSATIONMODE)) { |
| 250 | 250 | $spa->SetConversationMode(true); |
| 251 | 251 | if (($conversationmode = self::$decoder->getElementContent()) !== false) { |
| 252 | - $spa->SetConversationMode((bool) $conversationmode); |
|
| 252 | + $spa->SetConversationMode((bool)$conversationmode); |
|
| 253 | 253 | if (!self::$decoder->getElementEndTag()) { |
| 254 | 254 | return false; |
| 255 | 255 | } |
@@ -1197,7 +1197,7 @@ discard block |
||
| 1197 | 1197 | } |
| 1198 | 1198 | |
| 1199 | 1199 | // Stream outgoing changes |
| 1200 | - if ($status == SYNC_STATUS_SUCCESS && $sc->GetParameter($spa, "getchanges") == true && $windowSize > 0 && (bool) $exporter) { |
|
| 1200 | + if ($status == SYNC_STATUS_SUCCESS && $sc->GetParameter($spa, "getchanges") == true && $windowSize > 0 && (bool)$exporter) { |
|
| 1201 | 1201 | self::$topCollector->AnnounceInformation(sprintf("Streaming data of %d objects", (($changecount > $windowSize) ? $windowSize : $changecount))); |
| 1202 | 1202 | |
| 1203 | 1203 | // Output message changes per folder |
@@ -1249,7 +1249,7 @@ discard block |
||
| 1249 | 1249 | |
| 1250 | 1250 | // $progress is not an array when exporting the last message |
| 1251 | 1251 | // so we get the number to display from the streamimporter if it's available |
| 1252 | - if ((bool) $streamimporter) { |
|
| 1252 | + if ((bool)$streamimporter) { |
|
| 1253 | 1253 | $n = $streamimporter->GetImportedMessages(); |
| 1254 | 1254 | } |
| 1255 | 1255 | |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | class Request { |
| 11 | - public const MAXMEMORYUSAGE = 0.9; // use max. 90% of allowed memory when syncing |
|
| 11 | + public const MAXMEMORYUSAGE = 0.9; // use max. 90% of allowed memory when syncing |
|
| 12 | 12 | public const UNKNOWN = "unknown"; |
| 13 | 13 | public const IMPERSONATE_DELIM = '#'; |
| 14 | 14 | |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | if (isset(self::$base64QueryDecoded['PolKey'])) { |
| 143 | - self::$policykey = (int) self::filterEvilInput(self::$base64QueryDecoded['PolKey'], self::NUMBERS_ONLY); |
|
| 143 | + self::$policykey = (int)self::filterEvilInput(self::$base64QueryDecoded['PolKey'], self::NUMBERS_ONLY); |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | if (isset(self::$base64QueryDecoded['ProtVer'])) { |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | else { |
| 199 | 199 | preg_replace_callback( |
| 200 | 200 | '/(\-?\d+)(.?)/', |
| 201 | - function ($m) { |
|
| 201 | + function($m) { |
|
| 202 | 202 | self::$memoryLimit = $m[1] * pow(1024, strpos('BKMG', $m[2])) * self::MAXMEMORYUSAGE; |
| 203 | 203 | }, |
| 204 | 204 | strtoupper($memoryLimit) |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | // the policy key might be set in Request::Initialize from the base64 encoded query |
| 223 | 223 | if (!isset(self::$policykey)) { |
| 224 | 224 | if (isset(self::$headers["x-ms-policykey"])) { |
| 225 | - self::$policykey = (int) self::filterEvilInput(self::$headers["x-ms-policykey"], self::NUMBERS_ONLY); |
|
| 225 | + self::$policykey = (int)self::filterEvilInput(self::$headers["x-ms-policykey"], self::NUMBERS_ONLY); |
|
| 226 | 226 | } |
| 227 | 227 | else { |
| 228 | 228 | self::$policykey = 0; |
@@ -637,7 +637,7 @@ discard block |
||
| 637 | 637 | * @return int |
| 638 | 638 | */ |
| 639 | 639 | public static function GetContentLength() { |
| 640 | - return (isset(self::$headers["content-length"])) ? (int) self::$headers["content-length"] : 0; |
|
| 640 | + return (isset(self::$headers["content-length"])) ? (int)self::$headers["content-length"] : 0; |
|
| 641 | 641 | } |
| 642 | 642 | |
| 643 | 643 | /** |
@@ -212,7 +212,7 @@ |
||
| 212 | 212 | $errstr = $error["message"]; |
| 213 | 213 | |
| 214 | 214 | // do NOT log PHP Notice, Warning, Deprecated or Strict as FATAL |
| 215 | - if ($errno & ~(E_NOTICE | E_WARNING | E_DEPRECATED | E_STRICT)) { |
|
| 215 | + if ($errno & ~(E_NOTICE|E_WARNING|E_DEPRECATED|E_STRICT)) { |
|
| 216 | 216 | SLog::Write(LOGLEVEL_FATAL, sprintf("Fatal error: %s:%d - %s (%s)", $errfile, $errline, $errstr, $errno)); |
| 217 | 217 | } |
| 218 | 218 | } |