Passed
Push — patch_1-1-9 ( 70f5ab...f2626d )
by Spuds
21:21 queued 15:06
created
sources/subs/ScheduledTask/RemoveOldDrafts.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,9 @@  discard block
 block discarded – undo
36 36
 		$db = database();
37 37
 
38 38
 		if (empty($modSettings['drafts_keep_days']))
39
-			return true;
39
+		{
40
+					return true;
41
+		}
40 42
 
41 43
 		// init
42 44
 		$drafts = array();
@@ -55,7 +57,9 @@  discard block
 block discarded – undo
55 57
 			)
56 58
 		);
57 59
 		while ($row = $db->fetch_row($request))
58
-			$drafts[] = (int) $row[0];
60
+		{
61
+					$drafts[] = (int) $row[0];
62
+		}
59 63
 		$db->free_result($request);
60 64
 
61 65
 		// If we have old one, remove them
Please login to merge, or discard this patch.
sources/subs/ScheduledTask/RemoveOldFollowups.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,7 +30,9 @@  discard block
 block discarded – undo
30 30
 		global $modSettings;
31 31
 
32 32
 		if (empty($modSettings['enableFollowup']))
33
-			return false;
33
+		{
34
+					return false;
35
+		}
34 36
 
35 37
 		$db = database();
36 38
 
@@ -48,11 +50,15 @@  discard block
 block discarded – undo
48 50
 		);
49 51
 		$remove = array();
50 52
 		while ($row = $db->fetch_assoc($request))
51
-			$remove[] = $row['derived_from'];
53
+		{
54
+					$remove[] = $row['derived_from'];
55
+		}
52 56
 		$db->free_result($request);
53 57
 
54 58
 		if (empty($remove))
55
-			return true;
59
+		{
60
+					return true;
61
+		}
56 62
 
57 63
 		require_once(SUBSDIR . '/FollowUps.subs.php');
58 64
 		removeFollowUpsByMessage($remove);
Please login to merge, or discard this patch.
sources/subs/ScheduledTask/RemoveTempAttachments.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,9 @@
 block discarded – undo
53 53
 					{
54 54
 						// Temp file is more than 5 hours old!
55 55
 						if ($file->getMTime() < time() - 18000)
56
-							@unlink($file->getPathname());
56
+						{
57
+													@unlink($file->getPathname());
58
+						}
57 59
 					}
58 60
 				}
59 61
 			}
Please login to merge, or discard this patch.
sources/subs/ScheduledTask/UserAccessMentions.php 1 patch
Braces   +27 added lines, -12 removed lines patch added patch discarded remove patch
@@ -58,7 +58,9 @@  discard block
 block discarded – undo
58 58
 			{
59 59
 				// Just to stay on the safe side...
60 60
 				if (empty($member))
61
-					continue;
61
+				{
62
+									continue;
63
+				}
62 64
 
63 65
 				$user_see_board = memberQuerySeeBoard($member);
64 66
 				$limit = 100;
@@ -97,9 +99,12 @@  discard block
 block discarded – undo
97 99
 						while ($row = $db->fetch_assoc($request))
98 100
 						{
99 101
 							if (empty($row['id_board']))
100
-								$remove[] = $row['id_mention'];
101
-							else
102
-								$mentions[] = $row['id_mention'];
102
+							{
103
+															$remove[] = $row['id_mention'];
104
+							}
105
+							else {
106
+															$mentions[] = $row['id_mention'];
107
+							}
103 108
 						}
104 109
 						$db->free_result($request);
105 110
 
@@ -110,10 +115,13 @@  discard block
 block discarded – undo
110 115
 
111 116
 						// If we found something toggle them and increment the start for the next round
112 117
 						if (!empty($mentions))
113
-							toggleMentionsAccessibility($mentions, $can == 'can');
118
+						{
119
+													toggleMentionsAccessibility($mentions, $can == 'can');
120
+						}
114 121
 						// Otherwise it means we have finished with this access level for this member
115
-						else
116
-							break;
122
+						else {
123
+													break;
124
+						}
117 125
 
118 126
 						// Next batch
119 127
 						$start += $limit;
@@ -135,7 +143,9 @@  discard block
 block discarded – undo
135 143
 
136 144
 			// If there are no more users, scheduleTaskImmediate can be stopped
137 145
 			if (empty($user_access_mentions))
138
-				removeScheduleTaskImmediate('user_access_mentions', false);
146
+			{
147
+							removeScheduleTaskImmediate('user_access_mentions', false);
148
+			}
139 149
 
140 150
 			return true;
141 151
 		}
@@ -164,7 +174,9 @@  discard block
 block discarded – undo
164 174
 			$db->free_result($request);
165 175
 
166 176
 			if ($remaining == 0)
167
-				$current_check = 0;
177
+			{
178
+							$current_check = 0;
179
+			}
168 180
 
169 181
 			// Grab users with mentions
170 182
 			$request = $db->query('', '
@@ -212,9 +224,12 @@  discard block
 block discarded – undo
212 224
 				if ($db->num_rows($request2) == 1)
213 225
 				{
214 226
 					if (!empty($modSettings['user_access_mentions']))
215
-						$modSettings['user_access_mentions'] = \Util::unserialize($modSettings['user_access_mentions']);
216
-					else
217
-						$modSettings['user_access_mentions'] = array();
227
+					{
228
+											$modSettings['user_access_mentions'] = \Util::unserialize($modSettings['user_access_mentions']);
229
+					}
230
+					else {
231
+											$modSettings['user_access_mentions'] = array();
232
+					}
218 233
 
219 234
 					// But if the member is already on the list, let's skip it
220 235
 					if (!isset($modSettings['user_access_mentions'][$row['id_member']]))
Please login to merge, or discard this patch.
sources/subs/ScheduledTask/ApprovalNotification.php 1 patch
Braces   +51 added lines, -18 removed lines patch added patch discarded remove patch
@@ -58,15 +58,22 @@  discard block
 block discarded – undo
58 58
 		{
59 59
 			// If this is no longer around we'll ignore it.
60 60
 			if (empty($row['id_topic']))
61
-				continue;
61
+			{
62
+							continue;
63
+			}
62 64
 
63 65
 			// What type is it?
64 66
 			if ($row['id_first_msg'] && $row['id_first_msg'] == $row['id_msg'])
65
-				$type = 'topic';
67
+			{
68
+							$type = 'topic';
69
+			}
66 70
 			elseif ($row['id_attach'])
67
-				$type = 'attach';
68
-			else
69
-				$type = 'msg';
71
+			{
72
+							$type = 'attach';
73
+			}
74
+			else {
75
+							$type = 'msg';
76
+			}
70 77
 
71 78
 			// Add it to the array otherwise.
72 79
 			$notices[$row['id_board']][$type][] = array(
@@ -88,7 +95,9 @@  discard block
 block discarded – undo
88 95
 
89 96
 		// If nothing quit now.
90 97
 		if (empty($notices))
91
-			return true;
98
+		{
99
+					return true;
100
+		}
92 101
 
93 102
 		// Now we need to think about finding out *who* can approve - this is hard!
94 103
 		// First off, get all the groups with this permission and sort by board.
@@ -109,13 +118,17 @@  discard block
 block discarded – undo
109 118
 		{
110 119
 			// Sorry guys, but we have to ignore guests AND members - it would be too many otherwise.
111 120
 			if ($row['id_group'] < 2)
112
-				continue;
121
+			{
122
+							continue;
123
+			}
113 124
 
114 125
 			$perms[$row['id_profile']][$row['add_deny'] ? 'add' : 'deny'][] = $row['id_group'];
115 126
 
116 127
 			// Anyone who can access has to be considered.
117 128
 			if ($row['add_deny'])
118
-				$addGroups[] = $row['id_group'];
129
+			{
130
+							$addGroups[] = $row['id_group'];
131
+			}
119 132
 		}
120 133
 		$db->free_result($request);
121 134
 
@@ -130,8 +143,10 @@  discard block
 block discarded – undo
130 143
 			// Make sure they get included in the big loop.
131 144
 			$members = array_keys($all_mods);
132 145
 			foreach ($all_mods as $rows)
133
-				foreach ($rows as $row)
146
+			{
147
+							foreach ($rows as $row)
134 148
 					$mods[$row['id_member']][$row['id_board']] = true;
149
+			}
135 150
 		}
136 151
 
137 152
 		// Come along one and all... until we reject you ;)
@@ -157,7 +172,9 @@  discard block
 block discarded – undo
157 172
 			{
158 173
 				list (,, $pref_binary) = explode('|', $row['mod_prefs']);
159 174
 				if (!($pref_binary & 4))
160
-					continue;
175
+				{
176
+									continue;
177
+				}
161 178
 			}
162 179
 
163 180
 			$members[$row['id_member']] = array(
@@ -185,7 +202,9 @@  discard block
 block discarded – undo
185 202
 
186 203
 			// Load the language file as required.
187 204
 			if (empty($current_language) || $current_language != $member['language'])
188
-				$current_language = loadLanguage('EmailTemplates', $member['language'], false);
205
+			{
206
+							$current_language = loadLanguage('EmailTemplates', $member['language'], false);
207
+			}
189 208
 
190 209
 			// Loop through each notice...
191 210
 			foreach ($notices as $board => $notice)
@@ -194,28 +213,38 @@  discard block
 block discarded – undo
194 213
 
195 214
 				// Can they mod in this board?
196 215
 				if (isset($mods[$id][$board]))
197
-					$access = true;
216
+				{
217
+									$access = true;
218
+				}
198 219
 
199 220
 				// Do the group check...
200 221
 				if (!$access && isset($perms[$profiles[$board]]['add']))
201 222
 				{
202 223
 					// They can access?!
203 224
 					if (array_intersect($perms[$profiles[$board]]['add'], $member['groups']))
204
-						$access = true;
225
+					{
226
+											$access = true;
227
+					}
205 228
 
206 229
 					// If they have deny rights don't consider them!
207 230
 					if (isset($perms[$profiles[$board]]['deny']))
208
-						if (array_intersect($perms[$profiles[$board]]['deny'], $member['groups']))
231
+					{
232
+											if (array_intersect($perms[$profiles[$board]]['deny'], $member['groups']))
209 233
 							$access = false;
234
+					}
210 235
 				}
211 236
 
212 237
 				// Finally, fix it for admins!
213 238
 				if (in_array(1, $member['groups']))
214
-					$access = true;
239
+				{
240
+									$access = true;
241
+				}
215 242
 
216 243
 				// If they can't access it then give it a break!
217 244
 				if (!$access)
218
-					continue;
245
+				{
246
+									continue;
247
+				}
219 248
 
220 249
 				foreach ($notice as $type => $items)
221 250
 				{
@@ -224,14 +253,18 @@  discard block
 block discarded – undo
224 253
 						'------------------------------------------------------' . "\n";
225 254
 
226 255
 					foreach ($items as $item)
227
-						$emailbody .= $item['subject'] . ' - ' . $item['href'] . "\n";
256
+					{
257
+											$emailbody .= $item['subject'] . ' - ' . $item['href'] . "\n";
258
+					}
228 259
 
229 260
 					$emailbody .= "\n";
230 261
 				}
231 262
 			}
232 263
 
233 264
 			if ($emailbody == '')
234
-				continue;
265
+			{
266
+							continue;
267
+			}
235 268
 
236 269
 			$replacements = array(
237 270
 				'REALNAME' => $member['name'],
Please login to merge, or discard this patch.
sources/subs/ScheduledTask/DailyDigest.php 1 patch
Braces   +51 added lines, -18 removed lines patch added patch discarded remove patch
@@ -60,7 +60,9 @@  discard block
 block discarded – undo
60 60
 		// If the maillist function is on then so is the enhanced digest
61 61
 		$maillist = !empty($modSettings['maillist_enabled']) && !empty($modSettings['maillist_digest_enabled']);
62 62
 		if ($maillist)
63
-			require_once(SUBSDIR . '/Emailpost.subs.php');
63
+		{
64
+					require_once(SUBSDIR . '/Emailpost.subs.php');
65
+		}
64 66
 
65 67
 		$is_weekly = !empty($is_weekly) ? 1 : 0;
66 68
 
@@ -101,21 +103,28 @@  discard block
 block discarded – undo
101 103
 			// Store this useful data!
102 104
 			$boards[$row['id_board']] = $row['id_board'];
103 105
 			if ($row['id_topic'])
104
-				$notify['topics'][$row['id_topic']][] = $row['id_member'];
105
-			else
106
-				$notify['boards'][$row['id_board']][] = $row['id_member'];
106
+			{
107
+							$notify['topics'][$row['id_topic']][] = $row['id_member'];
108
+			}
109
+			else {
110
+							$notify['boards'][$row['id_board']][] = $row['id_member'];
111
+			}
107 112
 		}
108 113
 		$db->free_result($request);
109 114
 
110 115
 		if (empty($boards))
111
-			return true;
116
+		{
117
+					return true;
118
+		}
112 119
 
113 120
 		// Just get the board names.
114 121
 		require_once(SUBSDIR . '/Boards.subs.php');
115 122
 		$boards = fetchBoardsInfo(array('boards' => $boards), array('override_permissions' => true));
116 123
 
117 124
 		if (empty($boards))
118
-			return true;
125
+		{
126
+					return true;
127
+		}
119 128
 
120 129
 		// Get the actual topics...
121 130
 		$request = $db->query('', '
@@ -141,11 +150,13 @@  discard block
 block discarded – undo
141 150
 		while ($row = $db->fetch_assoc($request))
142 151
 		{
143 152
 			if (!isset($types[$row['note_type']][$row['id_board']]))
144
-				$types[$row['note_type']][$row['id_board']] = array(
153
+			{
154
+							$types[$row['note_type']][$row['id_board']] = array(
145 155
 					'lines' => array(),
146 156
 					'name' => un_htmlspecialchars($row['board_name']),
147 157
 					'id' => $row['id_board'],
148 158
 				);
159
+			}
149 160
 
150 161
 			// A reply has been made
151 162
 			if ($row['note_type'] === 'reply')
@@ -188,12 +199,14 @@  discard block
 block discarded – undo
188 199
 
189 200
 				// Topics are simple since we are only concerned with the first post
190 201
 				if (!isset($types[$row['note_type']][$row['id_board']]['lines'][$row['id_topic']]))
191
-					$types[$row['note_type']][$row['id_board']]['lines'][$row['id_topic']] = array(
202
+				{
203
+									$types[$row['note_type']][$row['id_board']]['lines'][$row['id_topic']] = array(
192 204
 						'id' => $row['id_topic'],
193 205
 						'link' => $scripturl . '?topic=' . $row['id_topic'] . '.new;topicseen#new',
194 206
 						'subject' => un_htmlspecialchars($row['subject']),
195 207
 						'body' => $row['body'],
196 208
 					);
209
+				}
197 210
 			}
198 211
 			elseif ($maillist && empty($modSettings['pbe_no_mod_notices']))
199 212
 			{
@@ -210,15 +223,21 @@  discard block
 block discarded – undo
210 223
 			$types[$row['note_type']][$row['id_board']]['lines'][$row['id_topic']]['members'] = array();
211 224
 
212 225
 			if (!empty($notify['topics'][$row['id_topic']]))
213
-				$types[$row['note_type']][$row['id_board']]['lines'][$row['id_topic']]['members'] = array_merge($types[$row['note_type']][$row['id_board']]['lines'][$row['id_topic']]['members'], $notify['topics'][$row['id_topic']]);
226
+			{
227
+							$types[$row['note_type']][$row['id_board']]['lines'][$row['id_topic']]['members'] = array_merge($types[$row['note_type']][$row['id_board']]['lines'][$row['id_topic']]['members'], $notify['topics'][$row['id_topic']]);
228
+			}
214 229
 
215 230
 			if (!empty($notify['boards'][$row['id_board']]))
216
-				$types[$row['note_type']][$row['id_board']]['lines'][$row['id_topic']]['members'] = array_merge($types[$row['note_type']][$row['id_board']]['lines'][$row['id_topic']]['members'], $notify['boards'][$row['id_board']]);
231
+			{
232
+							$types[$row['note_type']][$row['id_board']]['lines'][$row['id_topic']]['members'] = array_merge($types[$row['note_type']][$row['id_board']]['lines'][$row['id_topic']]['members'], $notify['boards'][$row['id_board']]);
233
+			}
217 234
 		}
218 235
 		$db->free_result($request);
219 236
 
220 237
 		if (empty($types))
221
-			return true;
238
+		{
239
+					return true;
240
+		}
222 241
 
223 242
 		// Fix the last reply message so its suitable for previewing
224 243
 		if ($maillist)
@@ -305,13 +324,17 @@  discard block
 block discarded – undo
305 324
 
306 325
 							$email['body'] .= "\n" . sprintf($langtxt[$lang]['topic_lines'], $topic['subject'], $board['name']);
307 326
 							if ($maillist)
308
-								$email['body'] .= $langtxt[$lang]['preview'] . $topic['body'] . $langtxt[$lang]['see_full'] . $topic['link'] . "\n";
327
+							{
328
+															$email['body'] .= $langtxt[$lang]['preview'] . $topic['body'] . $langtxt[$lang]['see_full'] . $topic['link'] . "\n";
329
+							}
309 330
 						}
310 331
 					}
311 332
 				}
312 333
 
313 334
 				if ($titled)
314
-					$email['body'] .= "\n";
335
+				{
336
+									$email['body'] .= "\n";
337
+				}
315 338
 			}
316 339
 
317 340
 			// What about replies?
@@ -336,13 +359,17 @@  discard block
 block discarded – undo
336 359
 
337 360
 							$email['body'] .= "\n" . ($topic['count'] === 1 ? sprintf($langtxt[$lang]['replies_one'], $topic['subject']) : sprintf($langtxt[$lang]['replies_many'], $topic['count'], $topic['subject']));
338 361
 							if ($maillist)
339
-								$email['body'] .= $langtxt[$lang]['reply_preview'] . $topic['body'] . $langtxt[$lang]['unread_reply_link'] . $topic['link'] . "\n";
362
+							{
363
+															$email['body'] .= $langtxt[$lang]['reply_preview'] . $topic['body'] . $langtxt[$lang]['unread_reply_link'] . $topic['link'] . "\n";
364
+							}
340 365
 						}
341 366
 					}
342 367
 				}
343 368
 
344 369
 				if ($titled)
345
-					$email['body'] .= "\n";
370
+				{
371
+									$email['body'] .= "\n";
372
+				}
346 373
 			}
347 374
 
348 375
 			// Finally, moderation actions!
@@ -350,7 +377,9 @@  discard block
 block discarded – undo
350 377
 			foreach ($types as $note_type => $type)
351 378
 			{
352 379
 				if ($note_type === 'topic' || $note_type === 'reply')
353
-					continue;
380
+				{
381
+									continue;
382
+				}
354 383
 
355 384
 				foreach ($type as $id => $board)
356 385
 				{
@@ -371,7 +400,9 @@  discard block
 block discarded – undo
371 400
 			}
372 401
 
373 402
 			if ($titled)
374
-				$email['body'] .= "\n";
403
+			{
404
+							$email['body'] .= "\n";
405
+			}
375 406
 
376 407
 			// Then just say our goodbyes!
377 408
 			$email['body'] .= "\n\n" . $langtxt[$lang]['bye'];
@@ -382,7 +413,9 @@  discard block
 block discarded – undo
382 413
 
383 414
 		// Using the queue, do a final flush before we say that's all folks
384 415
 		if (!empty($modSettings['mail_queue']))
385
-			AddMailQueue(true);
416
+		{
417
+					AddMailQueue(true);
418
+		}
386 419
 
387 420
 		// Clean up...
388 421
 		if ($is_weekly)
Please login to merge, or discard this patch.
sources/subs/ScheduledTask/DailyMaintenance.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -62,7 +62,9 @@  discard block
 block discarded – undo
62 62
 			);
63 63
 			$members = array();
64 64
 			while ($row = $db->fetch_assoc($request))
65
-				$members[$row['id_member']] = $row['warning'];
65
+			{
66
+							$members[$row['id_member']] = $row['warning'];
67
+			}
66 68
 			$db->free_result($request);
67 69
 
68 70
 			// Have some members to check?
@@ -85,10 +87,12 @@  discard block
 block discarded – undo
85 87
 				{
86 88
 					// More than 24 hours ago?
87 89
 					if ($row['last_warning'] <= time() - 86400)
88
-						$member_changes[] = array(
90
+					{
91
+											$member_changes[] = array(
89 92
 							'id' => $row['id_recipient'],
90 93
 							'warning' => $members[$row['id_recipient']] >= $modSettings['warning_decrement'] ? $members[$row['id_recipient']] - $modSettings['warning_decrement'] : 0,
91 94
 						);
95
+					}
92 96
 				}
93 97
 				$db->free_result($request);
94 98
 
@@ -97,7 +101,9 @@  discard block
 block discarded – undo
97 101
 				{
98 102
 					require_once(SUBSDIR . '/Members.subs.php');
99 103
 					foreach ($member_changes as $change)
100
-						updateMemberData($change['id'], array('warning' => $change['warning']));
104
+					{
105
+											updateMemberData($change['id'], array('warning' => $change['warning']));
106
+					}
101 107
 				}
102 108
 			}
103 109
 		}
@@ -118,7 +124,9 @@  discard block
 block discarded – undo
118 124
 			$openID->setup_DH(true);
119 125
 		}
120 126
 		elseif (!empty($modSettings['dh_keys']))
121
-			removeSettings('dh_keys');
127
+		{
128
+					removeSettings('dh_keys');
129
+		}
122 130
 
123 131
 		// Clean up some old login history information.
124 132
 		$db->query('', '
Please login to merge, or discard this patch.
sources/subs/ScheduledTask/Birthdayemails.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,9 @@
 block discarded – undo
71 71
 		while ($row = $db->fetch_assoc($result))
72 72
 		{
73 73
 			if (!isset($birthdays[$row['lngfile']]))
74
-				$birthdays[$row['lngfile']] = array();
74
+			{
75
+							$birthdays[$row['lngfile']] = array();
76
+			}
75 77
 			$birthdays[$row['lngfile']][$row['id_member']] = array(
76 78
 				'name' => $row['real_name'],
77 79
 				'email' => $row['email_address']
Please login to merge, or discard this patch.
sources/subs/ScheduledTask/WeeklyMaintenance.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,7 +71,9 @@  discard block
 block discarded – undo
71 71
 		if (!empty($modSettings['pruningOptions']))
72 72
 		{
73 73
 			if (!empty($modSettings['pruningOptions']) && strpos($modSettings['pruningOptions'], ',') !== false)
74
-				list ($modSettings['pruneErrorLog'], $modSettings['pruneModLog'], $modSettings['pruneBanLog'], $modSettings['pruneReportLog'], $modSettings['pruneScheduledTaskLog'], $modSettings['pruneSpiderHitLog']) = explode(',', $modSettings['pruningOptions']);
74
+			{
75
+							list ($modSettings['pruneErrorLog'], $modSettings['pruneModLog'], $modSettings['pruneBanLog'], $modSettings['pruneReportLog'], $modSettings['pruneScheduledTaskLog'], $modSettings['pruneSpiderHitLog']) = explode(',', $modSettings['pruningOptions']);
76
+			}
75 77
 
76 78
 			if (!empty($modSettings['pruneErrorLog']))
77 79
 			{
@@ -149,7 +151,9 @@  discard block
 block discarded – undo
149 151
 					)
150 152
 				);
151 153
 				while ($row = $db->fetch_row($result))
152
-					$reports[] = $row[0];
154
+				{
155
+									$reports[] = $row[0];
156
+				}
153 157
 				$db->free_result($result);
154 158
 
155 159
 				if (!empty($reports))
Please login to merge, or discard this patch.