Passed
Push — master ( 34e8da...f497d2 )
by
unknown
06:10 queued 02:50
created
version.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 	$branch = trim(exec("hash git 2>/dev/null && cd {$path} >/dev/null 2>&1 && git branch --no-color 2>/dev/null | sed -e '/^[^*]/d' -e \"s/* \\(.*\\)/\\1/\""));
11 11
 	$version = exec("hash git 2>/dev/null && cd {$path} >/dev/null 2>&1 && git describe  --always 2>/dev/null");
12 12
 	if ($branch && $version) {
13
-		define("GROMMUNIOSYNC_VERSION", $branch . '-' . $version);
13
+		define("GROMMUNIOSYNC_VERSION", $branch.'-'.$version);
14 14
 	}
15 15
 	else {
16 16
 		define("GROMMUNIOSYNC_VERSION", "GIT");
Please login to merge, or discard this patch.
mapi/class.meetingrequest.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -152,15 +152,15 @@  discard block
 block discarded – undo
152 152
 		$properties['reminderminutes'] = 'PT_LONG:PSETID_Common:0x8501';
153 153
 		$properties['reminderset'] = 'PT_BOOLEAN:PSETID_Common:0x8503';
154 154
 		$properties['sendasical'] = 'PT_BOOLEAN:PSETID_Appointment:0x8200';
155
-		$properties['updatecounter'] = 'PT_LONG:PSETID_Appointment:0x8201';                    // AppointmentSequenceNumber
156
-		$properties['last_updatecounter'] = 'PT_LONG:PSETID_Appointment:0x8203';            // AppointmentLastSequence
155
+		$properties['updatecounter'] = 'PT_LONG:PSETID_Appointment:0x8201'; // AppointmentSequenceNumber
156
+		$properties['last_updatecounter'] = 'PT_LONG:PSETID_Appointment:0x8203'; // AppointmentLastSequence
157 157
 		$properties['unknown7'] = 'PT_LONG:PSETID_Appointment:0x8202';
158 158
 		$properties['busystatus'] = 'PT_LONG:PSETID_Appointment:0x8205';
159 159
 		$properties['intendedbusystatus'] = 'PT_LONG:PSETID_Appointment:0x8224';
160 160
 		$properties['start'] = 'PT_SYSTIME:PSETID_Appointment:0x820d';
161 161
 		$properties['responselocation'] = 'PT_STRING8:PSETID_Meeting:0x2';
162 162
 		$properties['location'] = 'PT_STRING8:PSETID_Appointment:0x8208';
163
-		$properties['requestsent'] = 'PT_BOOLEAN:PSETID_Appointment:0x8229';        // PidLidFInvited, MeetingRequestWasSent
163
+		$properties['requestsent'] = 'PT_BOOLEAN:PSETID_Appointment:0x8229'; // PidLidFInvited, MeetingRequestWasSent
164 164
 		$properties['startdate'] = 'PT_SYSTIME:PSETID_Appointment:0x820d';
165 165
 		$properties['duedate'] = 'PT_SYSTIME:PSETID_Appointment:0x820e';
166 166
 		$properties['flagdueby'] = 'PT_SYSTIME:PSETID_Common:0x8560';
@@ -169,11 +169,11 @@  discard block
 block discarded – undo
169 169
 		$properties['recurring'] = 'PT_BOOLEAN:PSETID_Appointment:0x8223';
170 170
 		$properties['clipstart'] = 'PT_SYSTIME:PSETID_Appointment:0x8235';
171 171
 		$properties['clipend'] = 'PT_SYSTIME:PSETID_Appointment:0x8236';
172
-		$properties['start_recur_date'] = 'PT_LONG:PSETID_Meeting:0xD';                // StartRecurTime
173
-		$properties['start_recur_time'] = 'PT_LONG:PSETID_Meeting:0xE';                // StartRecurTime
174
-		$properties['end_recur_date'] = 'PT_LONG:PSETID_Meeting:0xF';                // EndRecurDate
175
-		$properties['end_recur_time'] = 'PT_LONG:PSETID_Meeting:0x10';                // EndRecurTime
176
-		$properties['is_exception'] = 'PT_BOOLEAN:PSETID_Meeting:0xA';                // LID_IS_EXCEPTION
172
+		$properties['start_recur_date'] = 'PT_LONG:PSETID_Meeting:0xD'; // StartRecurTime
173
+		$properties['start_recur_time'] = 'PT_LONG:PSETID_Meeting:0xE'; // StartRecurTime
174
+		$properties['end_recur_date'] = 'PT_LONG:PSETID_Meeting:0xF'; // EndRecurDate
175
+		$properties['end_recur_time'] = 'PT_LONG:PSETID_Meeting:0x10'; // EndRecurTime
176
+		$properties['is_exception'] = 'PT_BOOLEAN:PSETID_Meeting:0xA'; // LID_IS_EXCEPTION
177 177
 		$properties['apptreplyname'] = 'PT_STRING8:PSETID_Appointment:0x8230';
178 178
 		// Propose new time properties
179 179
 		$properties['proposed_start_whole'] = 'PT_SYSTIME:PSETID_Appointment:0x8250';
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
 		$listProperties['rcvd_representing_search_key'] = PR_RCVD_REPRESENTING_SEARCH_KEY;
546 546
 		$messageProps = mapi_getprops($this->message, $listProperties);
547 547
 
548
-		$goid = $messageProps[$this->proptags['goid']];    // GlobalID (0x3)
548
+		$goid = $messageProps[$this->proptags['goid']]; // GlobalID (0x3)
549 549
 		if (!isset($goid)) {
550 550
 			return;
551 551
 		}
@@ -1436,7 +1436,7 @@  discard block
 block discarded – undo
1436 1436
 		$props[$this->proptags['goid2']] = $goid;
1437 1437
 
1438 1438
 		if (!isset($props[$this->proptags['updatecounter']])) {
1439
-			$props[$this->proptags['updatecounter']] = 0;            // OL also starts sequence no with zero.
1439
+			$props[$this->proptags['updatecounter']] = 0; // OL also starts sequence no with zero.
1440 1440
 			$props[$this->proptags['last_updatecounter']] = 0;
1441 1441
 		}
1442 1442
 
@@ -2074,9 +2074,9 @@  discard block
 block discarded – undo
2074 2074
 			$subjectprefix = _('New Time Proposed');
2075 2075
 		}
2076 2076
 
2077
-		$props[PR_SUBJECT] = $subjectprefix . ': ' . $messageprops[PR_SUBJECT];
2077
+		$props[PR_SUBJECT] = $subjectprefix.': '.$messageprops[PR_SUBJECT];
2078 2078
 
2079
-		$props[PR_MESSAGE_CLASS] = 'IPM.Schedule.Meeting.Resp.' . $classpostfix;
2079
+		$props[PR_MESSAGE_CLASS] = 'IPM.Schedule.Meeting.Resp.'.$classpostfix;
2080 2080
 		if (isset($messageprops[PR_OWNER_APPT_ID])) {
2081 2081
 			$props[PR_OWNER_APPT_ID] = $messageprops[PR_OWNER_APPT_ID];
2082 2082
 		}
@@ -2285,12 +2285,12 @@  discard block
 block discarded – undo
2285 2285
 		$hasOrganizer = false;
2286 2286
 		// Check if meeting already has an organizer.
2287 2287
 		foreach ($recipients as $key => $recipient) {
2288
-			if (isset($recipient[PR_RECIPIENT_FLAGS]) && $recipient[PR_RECIPIENT_FLAGS] == (recipSendable | recipOrganizer)) {
2288
+			if (isset($recipient[PR_RECIPIENT_FLAGS]) && $recipient[PR_RECIPIENT_FLAGS] == (recipSendable|recipOrganizer)) {
2289 2289
 				$hasOrganizer = true;
2290 2290
 			}
2291 2291
 			elseif ($isException && !isset($recipient[PR_RECIPIENT_FLAGS])) {
2292 2292
 				// Recipients for an occurrence
2293
-				$recipients[$key][PR_RECIPIENT_FLAGS] = recipSendable | recipExceptionalResponse;
2293
+				$recipients[$key][PR_RECIPIENT_FLAGS] = recipSendable|recipExceptionalResponse;
2294 2294
 			}
2295 2295
 		}
2296 2296
 
@@ -2304,7 +2304,7 @@  discard block
 block discarded – undo
2304 2304
 			$organizer[PR_RECIPIENT_DISPLAY_NAME] = $messageProps[PR_SENT_REPRESENTING_NAME];
2305 2305
 			$organizer[PR_ADDRTYPE] = empty($messageProps[PR_SENT_REPRESENTING_ADDRTYPE]) ? 'SMTP' : $messageProps[PR_SENT_REPRESENTING_ADDRTYPE];
2306 2306
 			$organizer[PR_RECIPIENT_TRACKSTATUS] = olRecipientTrackStatusNone;
2307
-			$organizer[PR_RECIPIENT_FLAGS] = recipSendable | recipOrganizer;
2307
+			$organizer[PR_RECIPIENT_FLAGS] = recipSendable|recipOrganizer;
2308 2308
 			$organizer[PR_SEARCH_KEY] = $messageProps[PR_SENT_REPRESENTING_SEARCH_KEY];
2309 2309
 
2310 2310
 			// Add organizer to recipients list.
@@ -2362,7 +2362,7 @@  discard block
 block discarded – undo
2362 2362
 		$month = $basedate ? sprintf('%02s', dechex(gmdate('m', $basedate))) : '00';
2363 2363
 		$day = $basedate ? sprintf('%02s', dechex(gmdate('d', $basedate))) : '00';
2364 2364
 
2365
-		return hex2bin(strtoupper(substr($hexguid, 0, 32) . $year . $month . $day . substr($hexguid, 40)));
2365
+		return hex2bin(strtoupper(substr($hexguid, 0, 32).$year.$month.$day.substr($hexguid, 40)));
2366 2366
 	}
2367 2367
 
2368 2368
 	/**
@@ -2400,7 +2400,7 @@  discard block
 block discarded – undo
2400 2400
 					continue;
2401 2401
 				}
2402 2402
 
2403
-				$attachOld = mapi_message_openattach($copyFrom, (int) $attachProps[PR_ATTACH_NUM]);
2403
+				$attachOld = mapi_message_openattach($copyFrom, (int)$attachProps[PR_ATTACH_NUM]);
2404 2404
 				$attachNewResourceMsg = mapi_message_createattach($copyTo);
2405 2405
 				mapi_copyto($attachOld, [], [], $attachNewResourceMsg, 0);
2406 2406
 				mapi_savechanges($attachNewResourceMsg);
@@ -2491,7 +2491,7 @@  discard block
 block discarded – undo
2491 2491
 				[
2492 2492
 					RES_PROPERTY,
2493 2493
 					[
2494
-						RELOP => RELOP_EQ,    // Equals recipient type 3: Resource
2494
+						RELOP => RELOP_EQ, // Equals recipient type 3: Resource
2495 2495
 						ULPROPTAG => PR_RECIPIENT_TYPE,
2496 2496
 						VALUE => [PR_RECIPIENT_TYPE => MAPI_BCC],
2497 2497
 					],
@@ -2623,7 +2623,7 @@  discard block
 block discarded – undo
2623 2623
 
2624 2624
 				// Prefix the subject if needed
2625 2625
 				if ($prefix && isset($messageprops[PR_SUBJECT])) {
2626
-					$messageprops[PR_SUBJECT] = $prefix . $messageprops[PR_SUBJECT];
2626
+					$messageprops[PR_SUBJECT] = $prefix.$messageprops[PR_SUBJECT];
2627 2627
 				}
2628 2628
 
2629 2629
 				// Set status to cancelled if needed
@@ -2773,7 +2773,7 @@  discard block
 block discarded – undo
2773 2773
 				[
2774 2774
 					RES_PROPERTY,
2775 2775
 					[
2776
-						RELOP => RELOP_EQ,    // Equals recipient type 3: Resource
2776
+						RELOP => RELOP_EQ, // Equals recipient type 3: Resource
2777 2777
 						ULPROPTAG => PR_RECIPIENT_TYPE,
2778 2778
 						VALUE => [PR_RECIPIENT_TYPE => MAPI_BCC],
2779 2779
 					],
@@ -3005,7 +3005,7 @@  discard block
 block discarded – undo
3005 3005
 				$restriction[1][] = [
3006 3006
 					RES_PROPERTY,
3007 3007
 					[
3008
-						RELOP => RELOP_NE,    // Does not equal recipient type: MAPI_BCC (Resource)
3008
+						RELOP => RELOP_NE, // Does not equal recipient type: MAPI_BCC (Resource)
3009 3009
 						ULPROPTAG => PR_RECIPIENT_TYPE,
3010 3010
 						VALUE => [PR_RECIPIENT_TYPE => MAPI_BCC],
3011 3011
 					],
@@ -3061,7 +3061,7 @@  discard block
 block discarded – undo
3061 3061
 
3062 3062
 		// Prefix the subject if needed
3063 3063
 		if ($prefix && isset($newmessageprops[PR_SUBJECT])) {
3064
-			$newmessageprops[PR_SUBJECT] = $prefix . $newmessageprops[PR_SUBJECT];
3064
+			$newmessageprops[PR_SUBJECT] = $prefix.$newmessageprops[PR_SUBJECT];
3065 3065
 		}
3066 3066
 
3067 3067
 		if (isset($newmessageprops[$this->proptags['categories']]) &&
@@ -3102,7 +3102,7 @@  discard block
 block discarded – undo
3102 3102
 									[
3103 3103
 										RES_PROPERTY,
3104 3104
 										[
3105
-											RELOP => RELOP_NE,    // Does not equal recipient type: MAPI_BCC (Resource)
3105
+											RELOP => RELOP_NE, // Does not equal recipient type: MAPI_BCC (Resource)
3106 3106
 											ULPROPTAG => PR_RECIPIENT_TYPE,
3107 3107
 											VALUE => [PR_RECIPIENT_TYPE => MAPI_BCC],
3108 3108
 										],
@@ -3209,9 +3209,9 @@  discard block
 block discarded – undo
3209 3209
 			$newmessageprops[PR_MESSAGE_CLASS] = 'IPM.Schedule.Meeting.Canceled';
3210 3210
 			$newmessageprops[$this->proptags['meetingstatus']] = olMeetingCanceled; // It's a cancel request
3211 3211
 			$newmessageprops[$this->proptags['busystatus']] = fbFree; // set the busy status as free
3212
-			$newmessageprops[PR_IMPORTANCE] = IMPORTANCE_HIGH;    // HIGH Importance
3212
+			$newmessageprops[PR_IMPORTANCE] = IMPORTANCE_HIGH; // HIGH Importance
3213 3213
 			if (isset($newmessageprops[PR_SUBJECT])) {
3214
-				$newmessageprops[PR_SUBJECT] = _('Canceled: ') . $newmessageprops[PR_SUBJECT];
3214
+				$newmessageprops[PR_SUBJECT] = _('Canceled: ').$newmessageprops[PR_SUBJECT];
3215 3215
 			}
3216 3216
 
3217 3217
 			mapi_setprops($new, $newmessageprops);
@@ -3269,12 +3269,12 @@  discard block
 block discarded – undo
3269 3269
 
3270 3270
 			// [0] => year, [1] => month, [2] => day, [3] => hour, [4] => minutes, [5] => seconds
3271 3271
 			// RecurStartDate = year * 512 + month_number * 32 + day_number
3272
-			$newmessageprops[$this->proptags['start_recur_date']] = (((int) $startDate[0]) * 512) + (((int) $startDate[1]) * 32) + ((int) $startDate[2]);
3272
+			$newmessageprops[$this->proptags['start_recur_date']] = (((int)$startDate[0]) * 512) + (((int)$startDate[1]) * 32) + ((int)$startDate[2]);
3273 3273
 			// RecurStartTime = hour * 4096 + minutes * 64 + seconds
3274
-			$newmessageprops[$this->proptags['start_recur_time']] = (((int) $startDate[3]) * 4096) + (((int) $startDate[4]) * 64) + ((int) $startDate[5]);
3274
+			$newmessageprops[$this->proptags['start_recur_time']] = (((int)$startDate[3]) * 4096) + (((int)$startDate[4]) * 64) + ((int)$startDate[5]);
3275 3275
 
3276
-			$newmessageprops[$this->proptags['end_recur_date']] = (((int) $endDate[0]) * 512) + (((int) $endDate[1]) * 32) + ((int) $endDate[2]);
3277
-			$newmessageprops[$this->proptags['end_recur_time']] = (((int) $endDate[3]) * 4096) + (((int) $endDate[4]) * 64) + ((int) $endDate[5]);
3276
+			$newmessageprops[$this->proptags['end_recur_date']] = (((int)$endDate[0]) * 512) + (((int)$endDate[1]) * 32) + ((int)$endDate[2]);
3277
+			$newmessageprops[$this->proptags['end_recur_time']] = (((int)$endDate[3]) * 4096) + (((int)$endDate[4]) * 64) + ((int)$endDate[5]);
3278 3278
 		}
3279 3279
 	}
3280 3280
 
Please login to merge, or discard this patch.
mapi/class.taskrecurrence.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 				$attachments = mapi_table_queryallrows($attachmentTable, [PR_ATTACH_NUM, PR_ATTACH_SIZE, PR_ATTACH_LONG_FILENAME, PR_ATTACHMENT_HIDDEN, PR_DISPLAY_NAME, PR_ATTACH_METHOD]);
285 285
 
286 286
 				foreach ($attachments as $attach_props) {
287
-					$attach_old = mapi_message_openattach($this->message, (int) $attach_props[PR_ATTACH_NUM]);
287
+					$attach_old = mapi_message_openattach($this->message, (int)$attach_props[PR_ATTACH_NUM]);
288 288
 					$attach_newResourceMsg = mapi_message_createattach($newMessage);
289 289
 
290 290
 					mapi_copyto($attach_old, [], [], $attach_newResourceMsg, 0);
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 			$separator = "------------\r\n";
302 302
 
303 303
 			if (!empty($msgbody) && strrpos($msgbody, $separator) === false) {
304
-				$msgbody = $separator . $msgbody;
304
+				$msgbody = $separator.$msgbody;
305 305
 				$stream = mapi_openproperty($this->message, PR_BODY, IID_IStream, STGM_TRANSACTED, 0);
306 306
 				mapi_stream_setsize($stream, strlen($msgbody));
307 307
 				mapi_stream_write($stream, $msgbody);
Please login to merge, or discard this patch.
mapi/mapicode.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
  * @param mixed $code
28 28
  */
29 29
 function make_mapi_e($code) {
30
-	return (int) mapi_make_scode(1, $code);
30
+	return (int)mapi_make_scode(1, $code);
31 31
 }
32 32
 
33 33
 /**
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
  * @param mixed $code
37 37
  */
38 38
 function make_mapi_s($code) {
39
-	return (int) mapi_make_scode(0, $code);
39
+	return (int)mapi_make_scode(0, $code);
40 40
 }
41 41
 
42 42
 /* From mapicode.h */
Please login to merge, or discard this patch.
mapi/class.recurrence.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -598,8 +598,8 @@  discard block
 block discarded – undo
598 598
 			}
599 599
 
600 600
 			// get timings of the first occurrence
601
-			$firstoccstartdate = isset($startocc) ? $start + (((int) $startocc) * 60) : $start;
602
-			$firstoccenddate = isset($endocc) ? $end + (((int) $endocc) * 60) : $end;
601
+			$firstoccstartdate = isset($startocc) ? $start + (((int)$startocc) * 60) : $start;
602
+			$firstoccenddate = isset($endocc) ? $end + (((int)$endocc) * 60) : $end;
603 603
 
604 604
 			$start = gmdate(_('d-m-Y'), $firstoccstartdate);
605 605
 			$end = gmdate(_('d-m-Y'), $firstoccenddate);
@@ -743,7 +743,7 @@  discard block
 block discarded – undo
743 743
 			$props[PR_EXCEPTION_ENDTIME] = $this->fromGMT($this->tz, $exception_props[$this->proptags["duedate"]]);
744 744
 			mapi_setprops($attachment, $props);
745 745
 
746
-			$imessage = mapi_attach_openobj($attachment, MAPI_CREATE | MAPI_MODIFY);
746
+			$imessage = mapi_attach_openobj($attachment, MAPI_CREATE|MAPI_MODIFY);
747 747
 
748 748
 			if ($copy_attach_from) {
749 749
 				$attachmentTable = mapi_message_getattachmenttable($copy_attach_from);
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
 					$attachments = mapi_table_queryallrows($attachmentTable, [PR_ATTACH_NUM, PR_ATTACH_SIZE, PR_ATTACH_LONG_FILENAME, PR_ATTACHMENT_HIDDEN, PR_DISPLAY_NAME, PR_ATTACH_METHOD]);
752 752
 
753 753
 					foreach ($attachments as $attach_props) {
754
-						$attach_old = mapi_message_openattach($copy_attach_from, (int) $attach_props[PR_ATTACH_NUM]);
754
+						$attach_old = mapi_message_openattach($copy_attach_from, (int)$attach_props[PR_ATTACH_NUM]);
755 755
 						$attach_newResourceMsg = mapi_message_createattach($imessage);
756 756
 						mapi_copyto($attach_old, [], [], $attach_newResourceMsg, 0);
757 757
 						mapi_savechanges($attach_newResourceMsg);
@@ -1123,13 +1123,13 @@  discard block
 block discarded – undo
1123 1123
 			// Remove all deleted recipients
1124 1124
 			if (isset($exception_recips['remove'])) {
1125 1125
 				foreach ($exception_recips['remove'] as &$recip) {
1126
-					if (!isset($recip[PR_RECIPIENT_FLAGS]) || $recip[PR_RECIPIENT_FLAGS] != (recipReserved | recipExceptionalDeleted | recipSendable)) {
1127
-						$recip[PR_RECIPIENT_FLAGS] = recipSendable | recipExceptionalDeleted;
1126
+					if (!isset($recip[PR_RECIPIENT_FLAGS]) || $recip[PR_RECIPIENT_FLAGS] != (recipReserved|recipExceptionalDeleted|recipSendable)) {
1127
+						$recip[PR_RECIPIENT_FLAGS] = recipSendable|recipExceptionalDeleted;
1128 1128
 					}
1129 1129
 					else {
1130
-						$recip[PR_RECIPIENT_FLAGS] = recipReserved | recipExceptionalDeleted | recipSendable;
1130
+						$recip[PR_RECIPIENT_FLAGS] = recipReserved|recipExceptionalDeleted|recipSendable;
1131 1131
 					}
1132
-					$recip[PR_RECIPIENT_TRACKSTATUS] = olResponseNone;        // No Response required
1132
+					$recip[PR_RECIPIENT_TRACKSTATUS] = olResponseNone; // No Response required
1133 1133
 				}
1134 1134
 				unset($recip);
1135 1135
 				mapi_message_modifyrecipients($exception, MODRECIP_MODIFY, $exception_recips['remove']);
@@ -1199,13 +1199,13 @@  discard block
 block discarded – undo
1199 1199
 
1200 1200
 						// If recipient is not in list of deleted recipient, add him
1201 1201
 						if (!$foundInDeletedRecipients) {
1202
-							if (!isset($recipient[PR_RECIPIENT_FLAGS]) || $recipient[PR_RECIPIENT_FLAGS] != (recipReserved | recipExceptionalDeleted | recipSendable)) {
1203
-								$recipient[PR_RECIPIENT_FLAGS] = recipSendable | recipExceptionalDeleted;
1202
+							if (!isset($recipient[PR_RECIPIENT_FLAGS]) || $recipient[PR_RECIPIENT_FLAGS] != (recipReserved|recipExceptionalDeleted|recipSendable)) {
1203
+								$recipient[PR_RECIPIENT_FLAGS] = recipSendable|recipExceptionalDeleted;
1204 1204
 							}
1205 1205
 							else {
1206
-								$recipient[PR_RECIPIENT_FLAGS] = recipReserved | recipExceptionalDeleted | recipSendable;
1206
+								$recipient[PR_RECIPIENT_FLAGS] = recipReserved|recipExceptionalDeleted|recipSendable;
1207 1207
 							}
1208
-							$recipient[PR_RECIPIENT_TRACKSTATUS] = olRecipientTrackStatusNone;    // No Response required
1208
+							$recipient[PR_RECIPIENT_TRACKSTATUS] = olRecipientTrackStatusNone; // No Response required
1209 1209
 							$deletedRecipients[] = $recipient;
1210 1210
 						}
1211 1211
 					}
@@ -1265,12 +1265,12 @@  discard block
 block discarded – undo
1265 1265
 			$hasOrganizer = false;
1266 1266
 			// Check if meeting already has an organizer.
1267 1267
 			foreach ($recipients as $key => $recipient) {
1268
-				if (isset($recipient[PR_RECIPIENT_FLAGS]) && $recipient[PR_RECIPIENT_FLAGS] == (recipSendable | recipOrganizer)) {
1268
+				if (isset($recipient[PR_RECIPIENT_FLAGS]) && $recipient[PR_RECIPIENT_FLAGS] == (recipSendable|recipOrganizer)) {
1269 1269
 					$hasOrganizer = true;
1270 1270
 				}
1271 1271
 				elseif ($isException && !isset($recipient[PR_RECIPIENT_FLAGS])) {
1272 1272
 					// Recipients for an occurrence
1273
-					$recipients[$key][PR_RECIPIENT_FLAGS] = recipSendable | recipExceptionalResponse;
1273
+					$recipients[$key][PR_RECIPIENT_FLAGS] = recipSendable|recipExceptionalResponse;
1274 1274
 				}
1275 1275
 			}
1276 1276
 
@@ -1284,7 +1284,7 @@  discard block
 block discarded – undo
1284 1284
 				$organizer[PR_RECIPIENT_DISPLAY_NAME] = $messageProps[PR_SENT_REPRESENTING_NAME];
1285 1285
 				$organizer[PR_ADDRTYPE] = empty($messageProps[PR_SENT_REPRESENTING_ADDRTYPE]) ? 'SMTP' : $messageProps[PR_SENT_REPRESENTING_ADDRTYPE];
1286 1286
 				$organizer[PR_RECIPIENT_TRACKSTATUS] = olRecipientTrackStatusNone;
1287
-				$organizer[PR_RECIPIENT_FLAGS] = recipSendable | recipOrganizer;
1287
+				$organizer[PR_RECIPIENT_FLAGS] = recipSendable|recipOrganizer;
1288 1288
 				$organizer[PR_SEARCH_KEY] = $messageProps[PR_SENT_REPRESENTING_SEARCH_KEY];
1289 1289
 
1290 1290
 				// Add organizer to recipients list.
Please login to merge, or discard this patch.
mapi/class.freebusypublish.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -218,7 +218,7 @@
 block discarded – undo
218 218
 					],
219 219
 				], // EXISTS OR
220 220
 			],
221
-		];        // global OR
221
+		]; // global OR
222 222
 
223 223
 		$contents = mapi_folder_getcontentstable($this->calendar);
224 224
 		mapi_table_restrict($contents, $restrict);
Please login to merge, or discard this patch.
mapi/class.baserecurrence.php 1 patch
Spacing   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -573,14 +573,14 @@  discard block
 block discarded – undo
573 573
 				return;
574 574
 			}
575 575
 
576
-			$rdata = pack("CCCCCCV", 0x04, 0x30, 0x04, 0x30, (int) $this->recur["type"], 0x20, (int) $this->recur["subtype"]);
576
+			$rdata = pack("CCCCCCV", 0x04, 0x30, 0x04, 0x30, (int)$this->recur["type"], 0x20, (int)$this->recur["subtype"]);
577 577
 
578 578
 			$weekstart = 1; // monday
579 579
 			$forwardcount = 0;
580 580
 			$restocc = 0;
581
-			$dayofweek = (int) gmdate("w", (int) $this->recur["start"]); // 0 (for Sunday) through 6 (for Saturday)
581
+			$dayofweek = (int)gmdate("w", (int)$this->recur["start"]); // 0 (for Sunday) through 6 (for Saturday)
582 582
 
583
-			$term = (int) $this->recur["type"];
583
+			$term = (int)$this->recur["type"];
584 584
 
585 585
 			switch ($term) {
586 586
 				case 0x0A:
@@ -596,12 +596,12 @@  discard block
 block discarded – undo
596 596
 					else {
597 597
 						// Daily every N days (everyN in minutes)
598 598
 
599
-						$everyn = ((int) $this->recur["everyn"]) / 1440;
599
+						$everyn = ((int)$this->recur["everyn"]) / 1440;
600 600
 
601 601
 						// Calc first occ
602
-						$firstocc = $this->unixDataToRecurData($this->recur["start"]) % ((int) $this->recur["everyn"]);
602
+						$firstocc = $this->unixDataToRecurData($this->recur["start"]) % ((int)$this->recur["everyn"]);
603 603
 
604
-						$rdata .= pack("VVV", $firstocc, (int) $this->recur["everyn"], $this->recur["regen"] ? 1 : 0);
604
+						$rdata .= pack("VVV", $firstocc, (int)$this->recur["everyn"], $this->recur["regen"] ? 1 : 0);
605 605
 					}
606 606
 
607 607
 					break;
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
 						$daycount = 0;
625 625
 						$dayskip = -1;
626 626
 						for ($j = 0; $j < 7; ++$j) {
627
-							if (((int) $this->recur["weekdays"]) & (1 << (($dayofweek + $j) % 7))) {
627
+							if (((int)$this->recur["weekdays"]) & (1 << (($dayofweek + $j) % 7))) {
628 628
 								if ($dayskip == -1) {
629 629
 									$dayskip = $j;
630 630
 								}
@@ -643,35 +643,35 @@  discard block
 block discarded – undo
643 643
 
644 644
 						// Check if the recurrence ends after a number of occurrences, in that case we must calculate the
645 645
 						// remaining occurrences based on the start of the recurrence.
646
-						if (((int) $this->recur["term"]) == 0x22) {
646
+						if (((int)$this->recur["term"]) == 0x22) {
647 647
 							// $weekskip is the amount of weeks to skip from the startdate before the first occurrence
648 648
 							// $forwardcount is the maximum number of week occurrences we can go ahead after the first occurrence that
649 649
 							// is still inside the recurrence. We subtract one to make sure that the last week is never forwarded over
650 650
 							// (eg when numoccur = 2, and daycount = 1)
651
-							$forwardcount = floor((int) ($this->recur["numoccur"] - 1) / $daycount);
651
+							$forwardcount = floor((int)($this->recur["numoccur"] - 1) / $daycount);
652 652
 
653 653
 							// $restocc is the number of occurrences left after $forwardcount whole weeks of occurrences, minus one
654 654
 							// for the occurrence on the first day
655
-							$restocc = ((int) $this->recur["numoccur"]) - ($forwardcount * $daycount) - 1;
655
+							$restocc = ((int)$this->recur["numoccur"]) - ($forwardcount * $daycount) - 1;
656 656
 
657 657
 							// $forwardcount is now the number of weeks we can go forward and still be inside the recurrence
658
-							$forwardcount *= (int) $this->recur["everyn"];
658
+							$forwardcount *= (int)$this->recur["everyn"];
659 659
 						}
660 660
 
661 661
 						// The real start is start + dayskip + weekskip-1 (since dayskip will already bring us into the next week)
662
-						$this->recur["start"] = ((int) $this->recur["start"]) + ($dayskip * 24 * 60 * 60) + ($weekskip * (((int) $this->recur["everyn"]) - 1) * 7 * 24 * 60 * 60);
662
+						$this->recur["start"] = ((int)$this->recur["start"]) + ($dayskip * 24 * 60 * 60) + ($weekskip * (((int)$this->recur["everyn"]) - 1) * 7 * 24 * 60 * 60);
663 663
 					}
664 664
 
665 665
 					// Calc first occ
666
-					$firstocc = ($this->unixDataToRecurData($this->recur["start"])) % (((int) $this->recur["everyn"]) * 7 * 24 * 60);
666
+					$firstocc = ($this->unixDataToRecurData($this->recur["start"])) % (((int)$this->recur["everyn"]) * 7 * 24 * 60);
667 667
 
668
-					$firstocc -= (((int) gmdate("w", (int) $this->recur["start"])) - 1) * 24 * 60;
668
+					$firstocc -= (((int)gmdate("w", (int)$this->recur["start"])) - 1) * 24 * 60;
669 669
 
670 670
 					if ($this->recur["regen"]) {
671
-						$rdata .= pack("VVV", $firstocc, (int) $this->recur["everyn"], 1);
671
+						$rdata .= pack("VVV", $firstocc, (int)$this->recur["everyn"], 1);
672 672
 					}
673 673
 					else {
674
-						$rdata .= pack("VVVV", $firstocc, (int) $this->recur["everyn"], 0, (int) $this->recur["weekdays"]);
674
+						$rdata .= pack("VVVV", $firstocc, (int)$this->recur["everyn"], 0, (int)$this->recur["weekdays"]);
675 675
 					}
676 676
 
677 677
 					break;
@@ -688,31 +688,31 @@  discard block
 block discarded – undo
688 688
 					}
689 689
 
690 690
 					if ($term == 0x0C /* monthly */) {
691
-						$everyn = (int) $this->recur["everyn"];
691
+						$everyn = (int)$this->recur["everyn"];
692 692
 					}
693 693
 					else {
694
-						$everyn = $this->recur["regen"] ? ((int) $this->recur["everyn"]) * 12 : 12;
694
+						$everyn = $this->recur["regen"] ? ((int)$this->recur["everyn"]) * 12 : 12;
695 695
 					}
696 696
 
697 697
 					// Get montday/month/year of original start
698
-					$curmonthday = gmdate("j", (int) $this->recur["start"]);
699
-					$curyear = gmdate("Y", (int) $this->recur["start"]);
700
-					$curmonth = gmdate("n", (int) $this->recur["start"]);
698
+					$curmonthday = gmdate("j", (int)$this->recur["start"]);
699
+					$curyear = gmdate("Y", (int)$this->recur["start"]);
700
+					$curmonth = gmdate("n", (int)$this->recur["start"]);
701 701
 
702 702
 					// Check if the recurrence ends after a number of occurrences, in that case we must calculate the
703 703
 					// remaining occurrences based on the start of the recurrence.
704
-					if (((int) $this->recur["term"]) == 0x22) {
704
+					if (((int)$this->recur["term"]) == 0x22) {
705 705
 						// $forwardcount is the number of occurrences we can skip and still be inside the recurrence range (minus
706 706
 						// one to make sure there are always at least one occurrence left)
707
-						$forwardcount = ((((int) $this->recur["numoccur"]) - 1) * $everyn);
707
+						$forwardcount = ((((int)$this->recur["numoccur"]) - 1) * $everyn);
708 708
 					}
709 709
 
710 710
 					// Get month for yearly on D'th day of month M
711 711
 					if ($term == 0x0D /* yearly */) {
712
-						$selmonth = floor(((int) $this->recur["month"]) / (24 * 60 * 29)) + 1; // 1=jan, 2=feb, eg
712
+						$selmonth = floor(((int)$this->recur["month"]) / (24 * 60 * 29)) + 1; // 1=jan, 2=feb, eg
713 713
 					}
714 714
 
715
-					switch ((int) $this->recur["subtype"]) {
715
+					switch ((int)$this->recur["subtype"]) {
716 716
 						// on D day of every M month
717 717
 						case 2:
718 718
 							if (!isset($this->recur["monthday"])) {
@@ -725,11 +725,11 @@  discard block
 block discarded – undo
725 725
 							// Go the beginning of the month
726 726
 							$this->recur["start"] -= ($curmonthday - 1) * 24 * 60 * 60;
727 727
 							// Go the the correct month day
728
-							$this->recur["start"] += (((int) $this->recur["monthday"]) - 1) * 24 * 60 * 60;
728
+							$this->recur["start"] += (((int)$this->recur["monthday"]) - 1) * 24 * 60 * 60;
729 729
 
730 730
 							// If the previous calculation gave us a start date different than the original start date, then we need to skip to the first occurrence
731
-							if (($term == 0x0C /* monthly */ && ((int) $this->recur["monthday"]) < $curmonthday) ||
732
-								($term == 0x0D /* yearly */ && ($selmonth != $curmonth || ($selmonth == $curmonth && ((int) $this->recur["monthday"]) < $curmonthday)))) {
731
+							if (($term == 0x0C /* monthly */ && ((int)$this->recur["monthday"]) < $curmonthday) ||
732
+								($term == 0x0D /* yearly */ && ($selmonth != $curmonth || ($selmonth == $curmonth && ((int)$this->recur["monthday"]) < $curmonthday)))) {
733 733
 								if ($term == 0x0D /* yearly */) {
734 734
 									if ($curmonth > $selmonth) {// go to next occurrence in 'everyn' months minus difference in first occurrence and original date
735 735
 										$count = $everyn - ($curmonth - $selmonth);
@@ -739,7 +739,7 @@  discard block
 block discarded – undo
739 739
 									}
740 740
 									else {
741 741
 										// Go to next occurrence while recurrence start date is greater than occurrence date but within same month
742
-										if (((int) $this->recur["monthday"]) < $curmonthday) {
742
+										if (((int)$this->recur["monthday"]) < $curmonthday) {
743 743
 											$count = $everyn;
744 744
 										}
745 745
 									}
@@ -765,33 +765,33 @@  discard block
 block discarded – undo
765 765
 							// of each month will overshoot in february (29 days). We compensate for that by checking
766 766
 							// if the day of the month we got is wrong, and then back up to the last day of the previous
767 767
 							// month.
768
-							if (((int) $this->recur["monthday"]) >= 28 && ((int) $this->recur["monthday"]) <= 31 &&
769
-								gmdate("j", ((int) $this->recur["start"])) < ((int) $this->recur["monthday"])) {
770
-								$this->recur["start"] -= gmdate("j", ((int) $this->recur["start"])) * 24 * 60 * 60;
768
+							if (((int)$this->recur["monthday"]) >= 28 && ((int)$this->recur["monthday"]) <= 31 &&
769
+								gmdate("j", ((int)$this->recur["start"])) < ((int)$this->recur["monthday"])) {
770
+								$this->recur["start"] -= gmdate("j", ((int)$this->recur["start"])) * 24 * 60 * 60;
771 771
 							}
772 772
 
773 773
 							// "start" is now the first occurrence
774 774
 
775 775
 							if ($term == 0x0C /* monthly */) {
776 776
 								// Calc first occ
777
-								$monthIndex = ((((12 % $everyn) * ((((int) gmdate("Y", $this->recur["start"])) - 1601) % $everyn)) % $everyn) + (((int) gmdate("n", $this->recur["start"])) - 1)) % $everyn;
777
+								$monthIndex = ((((12 % $everyn) * ((((int)gmdate("Y", $this->recur["start"])) - 1601) % $everyn)) % $everyn) + (((int)gmdate("n", $this->recur["start"])) - 1)) % $everyn;
778 778
 
779 779
 								$firstocc = 0;
780 780
 								for ($i = 0; $i < $monthIndex; ++$i) {
781 781
 									$firstocc += $this->getMonthInSeconds(1601 + floor($i / 12), ($i % 12) + 1) / 60;
782 782
 								}
783 783
 
784
-								$rdata .= pack("VVVV", $firstocc, $everyn, $this->recur["regen"], (int) $this->recur["monthday"]);
784
+								$rdata .= pack("VVVV", $firstocc, $everyn, $this->recur["regen"], (int)$this->recur["monthday"]);
785 785
 							}
786 786
 							else {
787 787
 								// Calc first occ
788 788
 								$firstocc = 0;
789
-								$monthIndex = (int) gmdate("n", $this->recur["start"]);
789
+								$monthIndex = (int)gmdate("n", $this->recur["start"]);
790 790
 								for ($i = 1; $i < $monthIndex; ++$i) {
791 791
 									$firstocc += $this->getMonthInSeconds(1601 + floor($i / 12), $i) / 60;
792 792
 								}
793 793
 
794
-								$rdata .= pack("VVVV", $firstocc, $everyn, $this->recur["regen"], (int) $this->recur["monthday"]);
794
+								$rdata .= pack("VVVV", $firstocc, $everyn, $this->recur["regen"], (int)$this->recur["monthday"]);
795 795
 							}
796 796
 
797 797
 							break;
@@ -803,11 +803,11 @@  discard block
 block discarded – undo
803 803
 								return;
804 804
 							}
805 805
 
806
-							$weekdays = (int) $this->recur["weekdays"];
807
-							$nday = (int) $this->recur["nday"];
806
+							$weekdays = (int)$this->recur["weekdays"];
807
+							$nday = (int)$this->recur["nday"];
808 808
 
809 809
 							// Calc startdate
810
-							$monthbegindow = (int) $this->recur["start"];
810
+							$monthbegindow = (int)$this->recur["start"];
811 811
 
812 812
 							if ($nday == 5) {
813 813
 								// Set date on the last day of the last month
@@ -842,12 +842,12 @@  discard block
 block discarded – undo
842 842
 
843 843
 								$dayofweek = gmdate("w", $monthbegindow);
844 844
 								for ($i = 0; $i < 7; ++$i) {
845
-									if ($nday == 5 && (($dayofweek - $i) % 7 >= 0) && (1 << (($dayofweek - $i) % 7)) & $weekdays) {
845
+									if ($nday == 5 && (($dayofweek - $i) % 7 >= 0) && (1 << (($dayofweek - $i) % 7))&$weekdays) {
846 846
 										$day = gmdate("j", $monthbegindow) - $i;
847 847
 
848 848
 										break;
849 849
 									}
850
-									if ($nday != 5 && (1 << (($dayofweek + $i) % 7)) & $weekdays) {
850
+									if ($nday != 5 && (1 << (($dayofweek + $i) % 7))&$weekdays) {
851 851
 										$day = (($nday - 1) * 7) + ($i + 1);
852 852
 
853 853
 										break;
@@ -855,7 +855,7 @@  discard block
 block discarded – undo
855 855
 								}
856 856
 
857 857
 								// Goto the next X month
858
-								if (isset($day) && ($day < gmdate("j", (int) $this->recur["start"]))) {
858
+								if (isset($day) && ($day < gmdate("j", (int)$this->recur["start"]))) {
859 859
 									if ($nday == 5) {
860 860
 										$monthbegindow += 24 * 60 * 60;
861 861
 										if ($curmonth == 12) {
@@ -887,12 +887,12 @@  discard block
 block discarded – undo
887 887
 							// Set start on the right day
888 888
 							$dayofweek = gmdate("w", $monthbegindow);
889 889
 							for ($i = 0; $i < 7; ++$i) {
890
-								if ($nday == 5 && (($dayofweek - $i) % 7) >= 0 && (1 << (($dayofweek - $i) % 7)) & $weekdays) {
890
+								if ($nday == 5 && (($dayofweek - $i) % 7) >= 0 && (1 << (($dayofweek - $i) % 7))&$weekdays) {
891 891
 									$day = $i;
892 892
 
893 893
 									break;
894 894
 								}
895
-								if ($nday != 5 && (1 << (($dayofweek + $i) % 7)) & $weekdays) {
895
+								if ($nday != 5 && (1 << (($dayofweek + $i) % 7))&$weekdays) {
896 896
 									$day = ($nday - 1) * 7 + ($i + 1);
897 897
 
898 898
 									break;
@@ -909,7 +909,7 @@  discard block
 block discarded – undo
909 909
 
910 910
 							if ($term == 0x0C /* monthly */) {
911 911
 								// Calc first occ
912
-								$monthIndex = ((((12 % $everyn) * (((int) gmdate("Y", $this->recur["start"]) - 1601) % $everyn)) % $everyn) + (((int) gmdate("n", $this->recur["start"])) - 1)) % $everyn;
912
+								$monthIndex = ((((12 % $everyn) * (((int)gmdate("Y", $this->recur["start"]) - 1601) % $everyn)) % $everyn) + (((int)gmdate("n", $this->recur["start"])) - 1)) % $everyn;
913 913
 
914 914
 								for ($i = 0; $i < $monthIndex; ++$i) {
915 915
 									$firstocc += $this->getMonthInSeconds(1601 + floor($i / 12), ($i % 12) + 1) / 60;
@@ -919,7 +919,7 @@  discard block
 block discarded – undo
919 919
 							}
920 920
 							else {
921 921
 								// Calc first occ
922
-								$monthIndex = (int) gmdate("n", $this->recur["start"]);
922
+								$monthIndex = (int)gmdate("n", $this->recur["start"]);
923 923
 
924 924
 								for ($i = 1; $i < $monthIndex; ++$i) {
925 925
 									$firstocc += $this->getMonthInSeconds(1601 + floor($i / 12), $i) / 60;
@@ -939,7 +939,7 @@  discard block
 block discarded – undo
939 939
 			}
940 940
 
941 941
 			// Terminate
942
-			$term = (int) $this->recur["term"];
942
+			$term = (int)$this->recur["term"];
943 943
 			$rdata .= pack("CCCC", $term, 0x20, 0x00, 0x00);
944 944
 
945 945
 			switch ($term) {
@@ -954,7 +954,7 @@  discard block
 block discarded – undo
954 954
 						return;
955 955
 					}
956 956
 
957
-					$rdata .= pack("V", (int) $this->recur["numoccur"]);
957
+					$rdata .= pack("V", (int)$this->recur["numoccur"]);
958 958
 
959 959
 					break;
960 960
 				// Never ends
@@ -965,7 +965,7 @@  discard block
 block discarded – undo
965 965
 			}
966 966
 
967 967
 			// Strange little thing for the recurrence type "every workday"
968
-			if (((int) $this->recur["type"]) == 0x0B && ((int) $this->recur["subtype"]) == 1) {
968
+			if (((int)$this->recur["type"]) == 0x0B && ((int)$this->recur["subtype"]) == 1) {
969 969
 				$rdata .= pack("V", 1);
970 970
 			}
971 971
 			else { // Other recurrences
@@ -1009,25 +1009,25 @@  discard block
 block discarded – undo
1009 1009
 			}
1010 1010
 
1011 1011
 			// Set start date
1012
-			$rdata .= pack("V", $this->unixDataToRecurData((int) $this->recur["start"]));
1012
+			$rdata .= pack("V", $this->unixDataToRecurData((int)$this->recur["start"]));
1013 1013
 
1014 1014
 			// Set enddate
1015 1015
 			switch ($term) {
1016 1016
 				// After the given enddate
1017 1017
 				case 0x21:
1018
-					$rdata .= pack("V", $this->unixDataToRecurData((int) $this->recur["end"]));
1018
+					$rdata .= pack("V", $this->unixDataToRecurData((int)$this->recur["end"]));
1019 1019
 
1020 1020
 					break;
1021 1021
 				// After a number of times
1022 1022
 				case 0x22:
1023 1023
 					// @todo: calculate enddate with intval($this->recur["startocc"]) + intval($this->recur["duration"]) > 24 hour
1024
-					$occenddate = (int) $this->recur["start"];
1024
+					$occenddate = (int)$this->recur["start"];
1025 1025
 
1026
-					switch ((int) $this->recur["type"]) {
1026
+					switch ((int)$this->recur["type"]) {
1027 1027
 						case 0x0A: // daily
1028 1028
 							if ($this->recur["subtype"] == 1) {
1029 1029
 								// Daily every workday
1030
-								$restocc = (int) $this->recur["numoccur"];
1030
+								$restocc = (int)$this->recur["numoccur"];
1031 1031
 
1032 1032
 								// Get starting weekday
1033 1033
 								$nowtime = $this->gmtime($occenddate);
@@ -1049,7 +1049,7 @@  discard block
 block discarded – undo
1049 1049
 							}
1050 1050
 							else {
1051 1051
 								// -1 because the first day already counts (from 1-1-1980 to 1-1-1980 is 1 occurrence)
1052
-								$occenddate += (((int) $this->recur["everyn"]) * 60 * (((int) $this->recur["numoccur"] - 1)));
1052
+								$occenddate += (((int)$this->recur["everyn"]) * 60 * (((int)$this->recur["numoccur"] - 1)));
1053 1053
 							}
1054 1054
 
1055 1055
 							break;
@@ -1068,11 +1068,11 @@  discard block
 block discarded – undo
1068 1068
 							for ($j = 1; $restocc > 0; ++$j) {
1069 1069
 								// Jump to the next week (which may be N weeks away) when going over the week boundary
1070 1070
 								if ((($dayofweek + $j) % 7) == $weekstart) {
1071
-									$occenddate += (((int) $this->recur["everyn"]) - 1) * 7 * 24 * 60 * 60;
1071
+									$occenddate += (((int)$this->recur["everyn"]) - 1) * 7 * 24 * 60 * 60;
1072 1072
 								}
1073 1073
 
1074 1074
 								// If this is a matching day, once less occurrence to process
1075
-								if (((int) $this->recur["weekdays"]) & (1 << (($dayofweek + $j) % 7))) {
1075
+								if (((int)$this->recur["weekdays"]) & (1 << (($dayofweek + $j) % 7))) {
1076 1076
 									--$restocc;
1077 1077
 								}
1078 1078
 
@@ -1084,11 +1084,11 @@  discard block
 block discarded – undo
1084 1084
 
1085 1085
 						case 0x0C: // monthly
1086 1086
 						case 0x0D: // yearly
1087
-							$curyear = gmdate("Y", (int) $this->recur["start"]);
1088
-							$curmonth = gmdate("n", (int) $this->recur["start"]);
1087
+							$curyear = gmdate("Y", (int)$this->recur["start"]);
1088
+							$curmonth = gmdate("n", (int)$this->recur["start"]);
1089 1089
 							// $forwardcount = months
1090 1090
 
1091
-							switch ((int) $this->recur["subtype"]) {
1091
+							switch ((int)$this->recur["subtype"]) {
1092 1092
 								case 2: // on D day of every M month
1093 1093
 									while ($forwardcount > 0) {
1094 1094
 										$occenddate += $this->getMonthInSeconds($curyear, $curmonth);
@@ -1104,8 +1104,8 @@  discard block
 block discarded – undo
1104 1104
 									}
1105 1105
 
1106 1106
 									// compensation between 28 and 31
1107
-									if (((int) $this->recur["monthday"]) >= 28 && ((int) $this->recur["monthday"]) <= 31 &&
1108
-										gmdate("j", $occenddate) < ((int) $this->recur["monthday"])) {
1107
+									if (((int)$this->recur["monthday"]) >= 28 && ((int)$this->recur["monthday"]) <= 31 &&
1108
+										gmdate("j", $occenddate) < ((int)$this->recur["monthday"])) {
1109 1109
 										if (gmdate("j", $occenddate) < 28) {
1110 1110
 											$occenddate -= gmdate("j", $occenddate) * 24 * 60 * 60;
1111 1111
 										}
@@ -1117,8 +1117,8 @@  discard block
 block discarded – undo
1117 1117
 									break;
1118 1118
 
1119 1119
 								case 3: // on Nth weekday of every M month
1120
-									$nday = (int) $this->recur["nday"]; // 1 tot 5
1121
-									$weekdays = (int) $this->recur["weekdays"];
1120
+									$nday = (int)$this->recur["nday"]; // 1 tot 5
1121
+									$weekdays = (int)$this->recur["weekdays"];
1122 1122
 
1123 1123
 									while ($forwardcount > 0) {
1124 1124
 										$occenddate += $this->getMonthInSeconds($curyear, $curmonth);
@@ -1144,12 +1144,12 @@  discard block
 block discarded – undo
1144 1144
 
1145 1145
 									$dayofweek = gmdate("w", $occenddate);
1146 1146
 									for ($i = 0; $i < 7; ++$i) {
1147
-										if ($nday == 5 && (($dayofweek - $i) % 7) >= 0 && (1 << (($dayofweek - $i) % 7)) & $weekdays) {
1147
+										if ($nday == 5 && (($dayofweek - $i) % 7) >= 0 && (1 << (($dayofweek - $i) % 7))&$weekdays) {
1148 1148
 											$occenddate -= $i * 24 * 60 * 60;
1149 1149
 
1150 1150
 											break;
1151 1151
 										}
1152
-										if ($nday != 5 && (1 << (($dayofweek + $i) % 7)) & $weekdays) {
1152
+										if ($nday != 5 && (1 << (($dayofweek + $i) % 7))&$weekdays) {
1153 1153
 											$occenddate += ($i + (($nday - 1) * 7)) * 24 * 60 * 60;
1154 1154
 
1155 1155
 											break;
@@ -1168,7 +1168,7 @@  discard block
 block discarded – undo
1168 1168
 
1169 1169
 					$this->recur["end"] = $occenddate;
1170 1170
 
1171
-					$rdata .= pack("V", $this->unixDataToRecurData((int) $this->recur["end"]));
1171
+					$rdata .= pack("V", $this->unixDataToRecurData((int)$this->recur["end"]));
1172 1172
 
1173 1173
 					break;
1174 1174
 				// Never ends
@@ -1181,12 +1181,12 @@  discard block
 block discarded – undo
1181 1181
 			}
1182 1182
 
1183 1183
 			// UTC date
1184
-			$utcstart = $this->toGMT($this->tz, (int) $this->recur["start"]);
1185
-			$utcend = $this->toGMT($this->tz, (int) $this->recur["end"]);
1184
+			$utcstart = $this->toGMT($this->tz, (int)$this->recur["start"]);
1185
+			$utcend = $this->toGMT($this->tz, (int)$this->recur["end"]);
1186 1186
 
1187 1187
 			// utc date+time
1188
-			$utcfirstoccstartdatetime = (isset($this->recur["startocc"])) ? $utcstart + (((int) $this->recur["startocc"]) * 60) : $utcstart;
1189
-			$utcfirstoccenddatetime = (isset($this->recur["endocc"])) ? $utcstart + (((int) $this->recur["endocc"]) * 60) : $utcstart;
1188
+			$utcfirstoccstartdatetime = (isset($this->recur["startocc"])) ? $utcstart + (((int)$this->recur["startocc"]) * 60) : $utcstart;
1189
+			$utcfirstoccenddatetime = (isset($this->recur["endocc"])) ? $utcstart + (((int)$this->recur["endocc"]) * 60) : $utcstart;
1190 1190
 
1191 1191
 			$propsToSet = [];
1192 1192
 			// update reminder time
@@ -1204,7 +1204,7 @@  discard block
 block discarded – undo
1204 1204
 
1205 1205
 				// recurrencetype
1206 1206
 				// Strange enough is the property recurrencetype, (type-0x9) and not the CDO recurrencetype
1207
-				$propsToSet[$this->proptags["recurrencetype"]] = ((int) $this->recur["type"]) - 0x9;
1207
+				$propsToSet[$this->proptags["recurrencetype"]] = ((int)$this->recur["type"]) - 0x9;
1208 1208
 
1209 1209
 				// set named prop 'side_effects' to 369, needed for Outlook to ask for single or total recurrence when deleting
1210 1210
 				$propsToSet[$this->proptags["side_effects"]] = 369;
@@ -1253,7 +1253,7 @@  discard block
 block discarded – undo
1253 1253
 
1254 1254
 			if (isset($this->recur["startocc"], $this->recur["endocc"])) {
1255 1255
 				// Set start and endtime in minutes
1256
-				$rdata .= pack("VV", (int) $this->recur["startocc"], (int) $this->recur["endocc"]);
1256
+				$rdata .= pack("VV", (int)$this->recur["startocc"], (int)$this->recur["endocc"]);
1257 1257
 			}
1258 1258
 
1259 1259
 			// Detailed exception data
@@ -1308,7 +1308,7 @@  discard block
 block discarded – undo
1308 1308
 					$subject = iconv("UTF-8", "windows-1252//TRANSLIT", $changed_item["subject"]);
1309 1309
 					$length = strlen($subject);
1310 1310
 					$rdata .= pack("vv", $length + 1, $length);
1311
-					$rdata .= pack("a" . $length, $subject);
1311
+					$rdata .= pack("a".$length, $subject);
1312 1312
 				}
1313 1313
 
1314 1314
 				if (isset($changed_item["remind_before"])) {
@@ -1323,7 +1323,7 @@  discard block
 block discarded – undo
1323 1323
 					$location = iconv("UTF-8", "windows-1252//TRANSLIT", $changed_item["location"]);
1324 1324
 					$length = strlen($location);
1325 1325
 					$rdata .= pack("vv", $length + 1, $length);
1326
-					$rdata .= pack("a" . $length, $location);
1326
+					$rdata .= pack("a".$length, $location);
1327 1327
 				}
1328 1328
 
1329 1329
 				if (isset($changed_item["busystatus"])) {
@@ -1354,14 +1354,14 @@  discard block
 block discarded – undo
1354 1354
 					$subject = iconv("UTF-8", "UCS-2LE", $changed_item["subject"]);
1355 1355
 					$length = iconv_strlen($subject, "UCS-2LE");
1356 1356
 					$rdata .= pack("v", $length);
1357
-					$rdata .= pack("a" . $length * 2, $subject);
1357
+					$rdata .= pack("a".$length * 2, $subject);
1358 1358
 				}
1359 1359
 
1360 1360
 				if (isset($changed_item["location"])) {
1361 1361
 					$location = iconv("UTF-8", "UCS-2LE", $changed_item["location"]);
1362 1362
 					$length = iconv_strlen($location, "UCS-2LE");
1363 1363
 					$rdata .= pack("v", $length);
1364
-					$rdata .= pack("a" . $length * 2, $location);
1364
+					$rdata .= pack("a".$length * 2, $location);
1365 1365
 				}
1366 1366
 
1367 1367
 				if (isset($changed_item["subject"]) || isset($changed_item["location"])) {
@@ -1918,7 +1918,7 @@  discard block
 block discarded – undo
1918 1918
 						}
1919 1919
 						elseif ($this->recur['regen']) {
1920 1920
 							$year_starttime = $this->gmtime($now);
1921
-							$is_next_leapyear = $this->isLeapYear($year_starttime['tm_year'] + 1900 + 1);    // +1 next year
1921
+							$is_next_leapyear = $this->isLeapYear($year_starttime['tm_year'] + 1900 + 1); // +1 next year
1922 1922
 							$now = $daystart + ($is_next_leapyear ? 31622400 /* Leap year in seconds */ : 31536000 /* year in seconds */);
1923 1923
 
1924 1924
 							if ($now <= $dayend) {
Please login to merge, or discard this patch.
mapi/class.baseexception.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,14 +54,14 @@
 block discarded – undo
54 54
 		// assign display message
55 55
 		$this->displayMessage = $displayMessage;
56 56
 
57
-		parent::__construct($errorMessage, (int) $code, $previous);
57
+		parent::__construct($errorMessage, (int)$code, $previous);
58 58
 	}
59 59
 
60 60
 	/**
61 61
 	 * @return string returns file name and line number combined where exception occurred
62 62
 	 */
63 63
 	public function getFileLine() {
64
-		return $this->getBaseFile() . ':' . $this->getLine();
64
+		return $this->getBaseFile().':'.$this->getLine();
65 65
 	}
66 66
 
67 67
 	/**
Please login to merge, or discard this patch.
mapi/mapi.util.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
  * @param mixed $guid
24 24
  */
25 25
 function makeGuid($guid) {
26
-	return pack("vvvv", hexdec(substr($guid, 5, 4)), hexdec(substr($guid, 1, 4)), hexdec(substr($guid, 10, 4)), hexdec(substr($guid, 15, 4))) . hex2bin(substr($guid, 20, 4)) . hex2bin(substr($guid, 25, 12));
26
+	return pack("vvvv", hexdec(substr($guid, 5, 4)), hexdec(substr($guid, 1, 4)), hexdec(substr($guid, 10, 4)), hexdec(substr($guid, 15, 4))).hex2bin(substr($guid, 20, 4)).hex2bin(substr($guid, 25, 12));
27 27
 }
28 28
 
29 29
 /**
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 			 * we have to manually typecast value to integer, so float will be converted in integer,
49 49
 			 * but still its out of bound for integer limit so it will be auto adjusted to minus value
50 50
 			 */
51
-			if ($errcode == (int) $value) {
51
+			if ($errcode == (int)$value) {
52 52
 				// Check that we have an actual MAPI error or warning definition
53 53
 				$prefix = substr($key, 0, 7);
54 54
 				if ($prefix == "MAPI_E_" || $prefix == "MAPI_W_") {
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	// error code not found, return hex value (this is a fix for 64-bit systems, we can't use the dechex() function for this)
65 65
 	$result = unpack("H*", pack("N", $errcode));
66 66
 
67
-	return "0x" . $result[1];
67
+	return "0x".$result[1];
68 68
 }
69 69
 
70 70
 /**
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
  * @param mixed $value
168 168
  */
169 169
 function DTE_IS_REMOTE_VALID($value) {
170
-	return (bool) ($value & DTE_FLAG_REMOTE_VALID);
170
+	return (bool)($value & DTE_FLAG_REMOTE_VALID);
171 171
 }
172 172
 
173 173
 /**
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
  * @param mixed $value
177 177
  */
178 178
 function DTE_IS_ACL_CAPABLE($value) {
179
-	return (bool) ($value & DTE_FLAG_ACL_CAPABLE);
179
+	return (bool)($value & DTE_FLAG_ACL_CAPABLE);
180 180
 }
181 181
 
182 182
 function DTE_REMOTE($value) {
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 			RES_OR,
227 227
 			[
228 228
 				[
229
-					RES_AND,    // Normal items: itemEnd must be after viewStart, itemStart must be before viewEnd
229
+					RES_AND, // Normal items: itemEnd must be after viewStart, itemStart must be before viewEnd
230 230
 					[
231 231
 						[
232 232
 							RES_PROPERTY,
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 					],
257 257
 				],
258 258
 			], // EXISTS OR
259
-		];        // global OR
259
+		]; // global OR
260 260
 
261 261
 	// Get requested properties, plus whatever we need
262 262
 	$proplist = [PR_ENTRYID, $properties["recurring"], $properties["recurring_data"], $properties["timezone_data"]];
Please login to merge, or discard this patch.