Completed
Pull Request — release-2.1 (#5058)
by 01
120:18 queued 71:00
created
Sources/MessageIndex.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 				' . (empty($sort_methods_table[$context['sort_by']]) ? '' : $sort_methods_table[$context['sort_by']]) . '
325 325
 				WHERE t.id_board = {int:current_board} '
326 326
 				. (!$modSettings['postmod_active'] || $context['can_approve_posts'] ? '' : '
327
-					AND (t.approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR t.id_member_started = {int:current_member}') . ')') .'
327
+					AND (t.approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR t.id_member_started = {int:current_member}') . ')') . '
328 328
 				ORDER BY is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' . $_REQUEST['sort'] . ($ascending ? '' : ' DESC') . '
329 329
 				LIMIT {int:maxindex}
330 330
 					OFFSET {int:start} ';
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 		SELECT
334 334
 			t.id_topic, t.num_replies, t.locked, t.num_views, t.is_sticky, t.id_poll, t.id_previous_board,
335 335
 			' . ($user_info['is_guest'] ? '0' : 'COALESCE(lt.id_msg, COALESCE(lmr.id_msg, -1)) + 1') . ' AS new_from,
336
-			' . ( $enableParticipation ? ' COALESCE(( SELECT 1 FROM {db_prefix}messages AS parti WHERE t.id_topic = parti.id_topic and parti.id_member = {int:current_member} LIMIT 1) , 0) as is_posted_in,
336
+			' . ($enableParticipation ? ' COALESCE(( SELECT 1 FROM {db_prefix}messages AS parti WHERE t.id_topic = parti.id_topic and parti.id_member = {int:current_member} LIMIT 1) , 0) as is_posted_in,
337 337
 			'	: '') . '
338 338
 			t.id_last_msg, t.approved, t.unapproved_posts, ml.poster_time AS last_poster_time, t.id_redirect_topic,
339 339
 			ml.id_msg_modified, ml.subject AS last_subject, ml.icon AS last_icon,
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 			LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = {int:current_board} AND lmr.id_member = {int:current_member})') . '
358 358
 			' . (!empty($message_index_tables) ? implode("\n\t\t\t\t", $message_index_tables) : '') . '
359 359
 			' . (!empty($message_index_wheres) ? ' WHERE ' . implode("\n\t\t\t\tAND ", $message_index_wheres) : '') . '
360
-		ORDER BY is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' . $_REQUEST['sort'] . ($ascending ? '' : ' DESC') ,
360
+		ORDER BY is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' . $_REQUEST['sort'] . ($ascending ? '' : ' DESC'),
361 361
 		$message_index_parameters
362 362
 	);
363 363
 
Please login to merge, or discard this patch.
Themes/default/PersonalMessage.template.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 
231 231
 				foreach ($message['custom_fields']['above_member'] as $custom)
232 232
 					echo '
233
-							<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
233
+							<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
234 234
 
235 235
 				echo '
236 236
 						</ul>
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 			if (!empty($message['custom_fields']['below_avatar']))
280 280
 				foreach ($message['custom_fields']['below_avatar'] as $custom)
281 281
 					echo '
282
-						<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
282
+						<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
283 283
 
284 284
 			if (!$message['member']['is_guest'])
285 285
 				echo '
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 
322 322
 					foreach ($message['custom_fields']['icons'] as $custom)
323 323
 						echo '
324
-								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
324
+								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
325 325
 
326 326
 					echo '
327 327
 							</ol>
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 				if (!empty($message['custom_fields']['standard']))
386 386
 					foreach ($message['custom_fields']['standard'] as $custom)
387 387
 						echo '
388
-						<li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>';
388
+						<li class="custom ', $custom['col_name'], '">', $custom['title'], ': ', $custom['value'], '</li>';
389 389
 
390 390
 				// Are we showing the warning status?
391 391
 				if ($message['member']['can_see_warning'])
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
 				if (!empty($message['custom_fields']['bottom_poster']))
397 397
 					foreach ($message['custom_fields']['bottom_poster'] as $custom)
398 398
 						echo '
399
-						<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
399
+						<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
400 400
 			}
401 401
 
402 402
 			// Done with the information about the poster... on to the post itself.
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
 
498 498
 				foreach ($message['custom_fields']['above_signature'] as $custom)
499 499
 					echo '
500
-								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
500
+								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
501 501
 
502 502
 				echo '
503 503
 							</ul>
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
 
521 521
 				foreach ($message['custom_fields']['below_signature'] as $custom)
522 522
 					echo '
523
-								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
523
+								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
524 524
 
525 525
 				echo '
526 526
 							</ul>
@@ -656,7 +656,7 @@  discard block
 block discarded – undo
656 656
 	while ($message = $context['get_pmessage']('subject'))
657 657
 	{
658 658
 		echo '
659
-			<tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '','">
659
+			<tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '', '">
660 660
 				<td class="table_icon pm_icon">
661 661
 					<script>
662 662
 						currentLabels[', $message['id'], '] = {';
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
 				<td class="pm_time">', $message['time'], '</td>
681 681
 				<td class="pm_subject">
682 682
 					', ($context['display_mode'] != 0 && $context['current_pm'] == $message['id'] ? '<img src="' . $settings['images_url'] . '/selected.png" alt="*">' : ''), '<a href="', ($context['display_mode'] == 0 || $context['current_pm'] == $message['id'] ? '' : ($scripturl . '?action=pm;pmid=' . $message['id'] . ';kstart;f=' . $context['folder'] . ';start=' . $context['start'] . ';sort=' . $context['sort_by'] . ($context['sort_direction'] == 'up' ? ';' : ';desc') . ($context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : ''))), '#msg', $message['id'], '">', $message['subject'], $message['is_unread'] ? '&nbsp;<span class="new_posts">' . $txt['new'] . '</span>' : '', '</a>
683
-					<span class="pm_inline_time"><span class="generic_icons ', ($context['from_or_to']=='to' && count($message['recipients']['to'])>1) ? 'people' : 'members', '"></span> ', ($context['from_or_to'] == 'from' ? $message['member']['link'] : (empty($message['recipients']['to']) ? '' : implode(', ', $message['recipients']['to']))), '  <span class="generic_icons time_online"></span> ', $message['time'], '</span>
683
+					<span class="pm_inline_time"><span class="generic_icons ', ($context['from_or_to'] == 'to' && count($message['recipients']['to']) > 1) ? 'people' : 'members', '"></span> ', ($context['from_or_to'] == 'from' ? $message['member']['link'] : (empty($message['recipients']['to']) ? '' : implode(', ', $message['recipients']['to']))), '  <span class="generic_icons time_online"></span> ', $message['time'], '</span>
684 684
 				</td>
685 685
 				<td class="pm_from_to">
686 686
 					', ($context['from_or_to'] == 'from' ? $message['member']['link'] : (empty($message['recipients']['to']) ? '' : implode(', ', $message['recipients']['to']))), '
@@ -957,13 +957,13 @@  discard block
 block discarded – undo
957 957
 				// You can only reply if they are not a guest...
958 958
 				if (!$message['member']['is_guest'])
959 959
 					echo '
960
-					<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button , '</a>', $context['menu_separator'], '
961
-					<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button , '</a> ', $context['menu_separator'];
960
+					<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button, '</a>', $context['menu_separator'], '
961
+					<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button, '</a> ', $context['menu_separator'];
962 962
 
963 963
 				// This is for "forwarding" - even if the member is gone.
964 964
 				else
965 965
 					echo '
966
-					<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button , '</a>', $context['menu_separator'];
966
+					<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button, '</a>', $context['menu_separator'];
967 967
 			}
968 968
 
969 969
 			echo '
@@ -1063,7 +1063,7 @@  discard block
 block discarded – undo
1063 1063
 				<div class="', empty($context['error_type']) || $context['error_type'] != 'serious' ? 'noticebox' : 'errorbox', '', empty($context['post_error']['messages']) ? ' hidden' : '', '" id="errors">
1064 1064
 					<dl>
1065 1065
 						<dt>
1066
-							<strong id="error_serious">', $txt['error_while_submitting'] , '</strong>
1066
+							<strong id="error_serious">', $txt['error_while_submitting'], '</strong>
1067 1067
 						</dt>
1068 1068
 						<dd class="error" id="error_list">
1069 1069
 							', empty($context['post_error']['messages']) ? '' : implode('<br>', $context['post_error']['messages']), '
@@ -1119,7 +1119,7 @@  discard block
 block discarded – undo
1119 1119
 						<span', (isset($context['post_error']['no_subject']) ? ' class="error"' : ''), ' id="caption_subject">', $txt['subject'], ':</span>
1120 1120
 					</dt>
1121 1121
 					<dd id="pm_subject">
1122
-						<input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"',isset($context['post_error']['no_subject']) ? ' class="error"' : '', '>
1122
+						<input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"', isset($context['post_error']['no_subject']) ? ' class="error"' : '', '>
1123 1123
 					</dd>
1124 1124
 				</dl>';
1125 1125
 
@@ -1472,7 +1472,7 @@  discard block
 block discarded – undo
1472 1472
 		echo '
1473 1473
 		<div class="block righttext">
1474 1474
 			<input type="submit" name="save" value="', $txt['save'], '" class="button">
1475
-			<input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'] ,'" class="button you_sure">
1475
+			<input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'], '" class="button you_sure">
1476 1476
 		</div>';
1477 1477
 
1478 1478
 	echo '
@@ -1636,7 +1636,7 @@  discard block
 block discarded – undo
1636 1636
 	if (!empty($context['rules']))
1637 1637
 		echo '
1638 1638
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
1639
-			<input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'] ,'" class="button smalltext you_sure">';
1639
+			<input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'], '" class="button smalltext you_sure">';
1640 1640
 
1641 1641
 	echo '
1642 1642
 		</div>
@@ -1879,9 +1879,9 @@  discard block
 block discarded – undo
1879 1879
 
1880 1880
 		echo '
1881 1881
 				<select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();">
1882
-					<option value="">', $txt['pm_rule_sel_action'] , ':</option>
1883
-					<option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'] , '</option>
1884
-					<option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'] , '</option>
1882
+					<option value="">', $txt['pm_rule_sel_action'], ':</option>
1883
+					<option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'], '</option>
1884
+					<option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'], '</option>
1885 1885
 				</select>
1886 1886
 				<span id="labdiv', $k, '">
1887 1887
 					<select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();">
@@ -1993,7 +1993,7 @@  discard block
 block discarded – undo
1993 1993
 			</div>
1994 1994
 			<ul class="quickbuttons">
1995 1995
 				<li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;id_draft=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons modifybutton"></span>', $txt['draft_edit'], '</a></li>
1996
-				<li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;delete=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['draft_remove'] ,'?" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['draft_delete'], '</a></li>
1996
+				<li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;delete=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['draft_remove'], '?" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['draft_delete'], '</a></li>
1997 1997
 			</ul>
1998 1998
 		</div><!-- .windowbg -->';
1999 1999
 		}
Please login to merge, or discard this patch.
Sources/ManageLanguages.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
 			'editlang' => array(
593 593
 				'header' => array(
594 594
 					'value' => '',
595
-				),'data' => array(
595
+				), 'data' => array(
596 596
 					'function' => function($rowData) use ($scripturl, $txt)
597 597
 					{
598 598
 						return sprintf('<a href="%1$s?action=admin;area=languages;sa=editlang;lid=%2$s" class="button">%3$s</a>', $scripturl, $rowData['id'], $txt['edit']);
@@ -1269,7 +1269,7 @@  discard block
 block discarded – undo
1269 1269
 					// Now create the string!
1270 1270
 					$final_saves[$entryKey] = array(
1271 1271
 						'find' => $entryValue['full'],
1272
-						'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n")))  . "\n" . '$' . $entryValue['type'] . '[\'' . $entryKey . '\'] = array(' . implode(', ', $items) . ');' . $entryValue['cruft'],
1272
+						'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n"))) . "\n" . '$' . $entryValue['type'] . '[\'' . $entryKey . '\'] = array(' . implode(', ', $items) . ');' . $entryValue['cruft'],
1273 1273
 					);
1274 1274
 				}
1275 1275
 			}
@@ -1291,7 +1291,7 @@  discard block
 block discarded – undo
1291 1291
 					// And save it
1292 1292
 					$final_saves[$entryKey] = array(
1293 1293
 						'find' => $entryValue['full'],
1294
-						'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n")))  . "\n" . '$' . $entryValue['type'] . '[\'' . $entryValue['key'] . '\'][' . $subKey . '] = ' . $save_strings[$entryValue['key']][$entryValue['subkey']] . ';' . $entryValue['cruft'],
1294
+						'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n"))) . "\n" . '$' . $entryValue['type'] . '[\'' . $entryValue['key'] . '\'][' . $subKey . '] = ' . $save_strings[$entryValue['key']][$entryValue['subkey']] . ';' . $entryValue['cruft'],
1295 1295
 					);
1296 1296
 				}
1297 1297
 
@@ -1301,7 +1301,7 @@  discard block
 block discarded – undo
1301 1301
 					$entryValue['entry'] = '\'\'';
1302 1302
 					$final_saves[$entryKey] = array(
1303 1303
 						'find' => $entryValue['full'],
1304
-						'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n")))  . "\n",
1304
+						'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n"))) . "\n",
1305 1305
 					);
1306 1306
 				}
1307 1307
 
@@ -1329,7 +1329,7 @@  discard block
 block discarded – undo
1329 1329
 					// And we know what to save now!
1330 1330
 					$final_saves[$entryKey] = array(
1331 1331
 						'find' => $entryValue['full'],
1332
-						'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n")))  . "\n" . '$' . $entryValue['type'] . '[\'' . $entryValue['key'] . '\'] = ' . $save_strings[$entryValue['key']] . ';' . $entryValue['cruft'],
1332
+						'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n"))) . "\n" . '$' . $entryValue['type'] . '[\'' . $entryValue['key'] . '\'] = ' . $save_strings[$entryValue['key']] . ';' . $entryValue['cruft'],
1333 1333
 					);
1334 1334
 				}
1335 1335
 				// Remove this entry only if it is allowed
@@ -1338,7 +1338,7 @@  discard block
 block discarded – undo
1338 1338
 					$entryValue['entry'] = '\'\'';
1339 1339
 					$final_saves[$entryKey] = array(
1340 1340
 						'find' => $entryValue['full'],
1341
-						'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n")))  . "\n",
1341
+						'replace' => '// ' . implode("\n// ", explode("\n", rtrim($entryValue['full'], "\n"))) . "\n",
1342 1342
 					);
1343 1343
 				}
1344 1344
 
@@ -1369,8 +1369,8 @@  discard block
 block discarded – undo
1369 1369
 						continue;
1370 1370
 
1371 1371
 					$final_saves[$string_key] = array(
1372
-						'find' => "\s*\?".'>$',
1373
-						'replace' => "\n\$" . $type . '[\'' . $string_key . '\'] = ' . $string_val['string'] . ';' . "\n\n?".'>',
1372
+						'find' => "\s*\?" . '>$',
1373
+						'replace' => "\n\$" . $type . '[\'' . $string_key . '\'] = ' . $string_val['string'] . ';' . "\n\n?" . '>',
1374 1374
 						'is_regex' => true,
1375 1375
 					);
1376 1376
 				}
@@ -1387,8 +1387,8 @@  discard block
 block discarded – undo
1387 1387
 						$subKey = ctype_digit(trim($substring_key, '\'')) ? trim($substring_key, '\'') : '\'' . $substring_key . '\'';
1388 1388
 
1389 1389
 						$final_saves[$string_key . '[' . $substring_key . ']'] = array(
1390
-							'find' => "\s*\?".'>$',
1391
-							'replace' => "\n\$" . $type . '[\'' . $string_key . '\'][' . $subKey . '] = ' . $substring_val['string'] . ';' . "\n\n?".'>',
1390
+							'find' => "\s*\?" . '>$',
1391
+							'replace' => "\n\$" . $type . '[\'' . $string_key . '\'][' . $subKey . '] = ' . $substring_val['string'] . ';' . "\n\n?" . '>',
1392 1392
 							'is_regex' => true,
1393 1393
 						);
1394 1394
 					}
Please login to merge, or discard this patch.
Sources/Subs-Editor.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1112,7 +1112,7 @@  discard block
 block discarded – undo
1112 1112
 		$lastlen = strlen($text = preg_replace($backToBackPattern, '', $text));
1113 1113
 
1114 1114
 	// Need to sort the tags by name length.
1115
-	uksort($valid_tags, function ($a, $b) {
1115
+	uksort($valid_tags, function($a, $b) {
1116 1116
 		return strlen($a) < strlen($b) ? 1 : -1;
1117 1117
 	});
1118 1118
 
@@ -1980,7 +1980,7 @@  discard block
 block discarded – undo
1980 1980
 		}
1981 1981
 
1982 1982
 		// Set proper extensions; do this post caching so cache doesn't become extension-specific
1983
-		array_walk_recursive($context['smileys'], function (&$filename, $key)
1983
+		array_walk_recursive($context['smileys'], function(&$filename, $key)
1984 1984
 			{
1985 1985
 				global $context, $user_info, $modSettings;
1986 1986
 				if ($key == 'filename')
Please login to merge, or discard this patch.
Sources/Subs.php 1 patch
Spacing   +114 added lines, -114 removed lines patch added patch discarded remove patch
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 			{
392 392
 				$val = 'CASE ';
393 393
 				foreach ($members as $k => $v)
394
-					$val .= 'WHEN id_member = ' . $v . ' THEN '. count(fetch_alerts($v, false, 0, array(), false)) . ' ';
394
+					$val .= 'WHEN id_member = ' . $v . ' THEN ' . count(fetch_alerts($v, false, 0, array(), false)) . ' ';
395 395
 				$val = $val . ' END';
396 396
 				$type = 'raw';
397 397
 			}
@@ -744,7 +744,7 @@  discard block
 block discarded – undo
744 744
 	static $non_twelve_hour, $locale_cache;
745 745
 	static $unsupportedFormats, $finalizedFormats;
746 746
 
747
-	$unsupportedFormatsWindows = array('z','Z');
747
+	$unsupportedFormatsWindows = array('z', 'Z');
748 748
 
749 749
 	// Ensure required values are set
750 750
 	$user_info['time_offset'] = !empty($user_info['time_offset']) ? $user_info['time_offset'] : 0;
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
 			$unsupportedFormats = (array) cache_get_data('unsupportedtimeformats', 86400);
830 830
 		if (empty($unsupportedFormats))
831 831
 		{
832
-			foreach($strftimeFormatSubstitutions as $format => $substitution)
832
+			foreach ($strftimeFormatSubstitutions as $format => $substitution)
833 833
 			{
834 834
 				// Avoid a crashing bug with PHP 7 on certain versions of Windows
835 835
 				if ($context['server']['is_windows'] && in_array($format, $unsupportedFormatsWindows))
@@ -1209,7 +1209,7 @@  discard block
 block discarded – undo
1209 1209
 					'height' => array('optional' => true, 'match' => '(\d+)'),
1210 1210
 				),
1211 1211
 				'content' => '$1',
1212
-				'validate' => function (&$tag, &$data, $disabled, $params) use ($modSettings, $context, $sourcedir, $txt)
1212
+				'validate' => function(&$tag, &$data, $disabled, $params) use ($modSettings, $context, $sourcedir, $txt)
1213 1213
 				{
1214 1214
 					$returnContext = '';
1215 1215
 
@@ -1244,7 +1244,7 @@  discard block
 block discarded – undo
1244 1244
 						}
1245 1245
 
1246 1246
 						if ($currentAttachment['thumbnail']['has_thumb'] && empty($params['{width}']) && empty($params['{height}']))
1247
-							$returnContext .= '<a href="'. $currentAttachment['href']. ';image" id="link_'. $currentAttachment['id']. '" onclick="'. $currentAttachment['thumbnail']['javascript']. '"><img src="'. $currentAttachment['thumbnail']['href']. '"' . $alt . $title . ' id="thumb_'. $currentAttachment['id']. '" class="atc_img"></a>';
1247
+							$returnContext .= '<a href="' . $currentAttachment['href'] . ';image" id="link_' . $currentAttachment['id'] . '" onclick="' . $currentAttachment['thumbnail']['javascript'] . '"><img src="' . $currentAttachment['thumbnail']['href'] . '"' . $alt . $title . ' id="thumb_' . $currentAttachment['id'] . '" class="atc_img"></a>';
1248 1248
 						else
1249 1249
 							$returnContext .= '<img src="' . $currentAttachment['href'] . ';image"' . $alt . $title . $width . $height . ' class="bbc_img"/>';
1250 1250
 					}
@@ -1296,7 +1296,7 @@  discard block
 block discarded – undo
1296 1296
 				'type' => 'unparsed_content',
1297 1297
 				'content' => '<div class="codeheader"><span class="code floatleft">' . $txt['code'] . '</span> <a class="codeoperation smf_select_text">' . $txt['code_select'] . '</a></div><code class="bbc_code">$1</code>',
1298 1298
 				// @todo Maybe this can be simplified?
1299
-				'validate' => isset($disabled['code']) ? null : function (&$tag, &$data, $disabled) use ($context)
1299
+				'validate' => isset($disabled['code']) ? null : function(&$tag, &$data, $disabled) use ($context)
1300 1300
 				{
1301 1301
 					if (!isset($disabled['code']))
1302 1302
 					{
@@ -1333,7 +1333,7 @@  discard block
 block discarded – undo
1333 1333
 				'type' => 'unparsed_equals_content',
1334 1334
 				'content' => '<div class="codeheader"><span class="code floatleft">' . $txt['code'] . '</span> ($2) <a class="codeoperation smf_select_text">' . $txt['code_select'] . '</a></div><code class="bbc_code">$1</code>',
1335 1335
 				// @todo Maybe this can be simplified?
1336
-				'validate' => isset($disabled['code']) ? null : function (&$tag, &$data, $disabled) use ($context)
1336
+				'validate' => isset($disabled['code']) ? null : function(&$tag, &$data, $disabled) use ($context)
1337 1337
 				{
1338 1338
 					if (!isset($disabled['code']))
1339 1339
 					{
@@ -1377,7 +1377,7 @@  discard block
 block discarded – undo
1377 1377
 				'type' => 'unparsed_content',
1378 1378
 				'content' => '<a href="mailto:$1" class="bbc_email">$1</a>',
1379 1379
 				// @todo Should this respect guest_hideContacts?
1380
-				'validate' => function (&$tag, &$data, $disabled)
1380
+				'validate' => function(&$tag, &$data, $disabled)
1381 1381
 				{
1382 1382
 					$data = strtr($data, array('<br>' => ''));
1383 1383
 				},
@@ -1397,7 +1397,7 @@  discard block
 block discarded – undo
1397 1397
 				'test' => '(left|right)(\s+max=\d+(?:%|px|em|rem|ex|pt|pc|ch|vw|vh|vmin|vmax|cm|mm|in)?)?\]',
1398 1398
 				'before' => '<div $1>',
1399 1399
 				'after' => '</div>',
1400
-				'validate' => function (&$tag, &$data, $disabled)
1400
+				'validate' => function(&$tag, &$data, $disabled)
1401 1401
 				{
1402 1402
 					$class = 'class="bbc_float float' . (strpos($data, 'left') === 0 ? 'left' : 'right') . '"';
1403 1403
 
@@ -1483,7 +1483,7 @@  discard block
 block discarded – undo
1483 1483
 					'height' => array('optional' => true, 'value' => ' height="$1"', 'match' => '(\d+)'),
1484 1484
 				),
1485 1485
 				'content' => '<img src="$1" alt="{alt}" title="{title}"{width}{height} class="bbc_img resized">',
1486
-				'validate' => function (&$tag, &$data, $disabled)
1486
+				'validate' => function(&$tag, &$data, $disabled)
1487 1487
 				{
1488 1488
 					global $image_proxy_enabled, $user_info;
1489 1489
 
@@ -1509,7 +1509,7 @@  discard block
 block discarded – undo
1509 1509
 				'tag' => 'img',
1510 1510
 				'type' => 'unparsed_content',
1511 1511
 				'content' => '<img src="$1" alt="" class="bbc_img">',
1512
-				'validate' => function (&$tag, &$data, $disabled)
1512
+				'validate' => function(&$tag, &$data, $disabled)
1513 1513
 				{
1514 1514
 					global $image_proxy_enabled, $user_info;
1515 1515
 
@@ -1535,7 +1535,7 @@  discard block
 block discarded – undo
1535 1535
 				'tag' => 'iurl',
1536 1536
 				'type' => 'unparsed_content',
1537 1537
 				'content' => '<a href="$1" class="bbc_link">$1</a>',
1538
-				'validate' => function (&$tag, &$data, $disabled)
1538
+				'validate' => function(&$tag, &$data, $disabled)
1539 1539
 				{
1540 1540
 					$data = strtr($data, array('<br>' => ''));
1541 1541
 					$scheme = parse_url($data, PHP_URL_SCHEME);
@@ -1549,7 +1549,7 @@  discard block
 block discarded – undo
1549 1549
 				'quoted' => 'optional',
1550 1550
 				'before' => '<a href="$1" class="bbc_link">',
1551 1551
 				'after' => '</a>',
1552
-				'validate' => function (&$tag, &$data, $disabled)
1552
+				'validate' => function(&$tag, &$data, $disabled)
1553 1553
 				{
1554 1554
 					if (substr($data, 0, 1) == '#')
1555 1555
 						$data = '#post_' . substr($data, 1);
@@ -1642,7 +1642,7 @@  discard block
 block discarded – undo
1642 1642
 				'tag' => 'php',
1643 1643
 				'type' => 'unparsed_content',
1644 1644
 				'content' => '<span class="phpcode">$1</span>',
1645
-				'validate' => isset($disabled['php']) ? null : function (&$tag, &$data, $disabled)
1645
+				'validate' => isset($disabled['php']) ? null : function(&$tag, &$data, $disabled)
1646 1646
 				{
1647 1647
 					if (!isset($disabled['php']))
1648 1648
 					{
@@ -1770,7 +1770,7 @@  discard block
 block discarded – undo
1770 1770
 				'test' => '[1-7]\]',
1771 1771
 				'before' => '<span style="font-size: $1;" class="bbc_size">',
1772 1772
 				'after' => '</span>',
1773
-				'validate' => function (&$tag, &$data, $disabled)
1773
+				'validate' => function(&$tag, &$data, $disabled)
1774 1774
 				{
1775 1775
 					$sizes = array(1 => 0.7, 2 => 1.0, 3 => 1.35, 4 => 1.45, 5 => 2.0, 6 => 2.65, 7 => 3.95);
1776 1776
 					$data = $sizes[$data] . 'em';
@@ -1808,7 +1808,7 @@  discard block
 block discarded – undo
1808 1808
 				'tag' => 'time',
1809 1809
 				'type' => 'unparsed_content',
1810 1810
 				'content' => '$1',
1811
-				'validate' => function (&$tag, &$data, $disabled)
1811
+				'validate' => function(&$tag, &$data, $disabled)
1812 1812
 				{
1813 1813
 					if (is_numeric($data))
1814 1814
 						$data = timeformat($data);
@@ -1841,7 +1841,7 @@  discard block
 block discarded – undo
1841 1841
 				'tag' => 'url',
1842 1842
 				'type' => 'unparsed_content',
1843 1843
 				'content' => '<a href="$1" class="bbc_link" target="_blank" rel="noopener">$1</a>',
1844
-				'validate' => function (&$tag, &$data, $disabled)
1844
+				'validate' => function(&$tag, &$data, $disabled)
1845 1845
 				{
1846 1846
 					$data = strtr($data, array('<br>' => ''));
1847 1847
 					$scheme = parse_url($data, PHP_URL_SCHEME);
@@ -1855,7 +1855,7 @@  discard block
 block discarded – undo
1855 1855
 				'quoted' => 'optional',
1856 1856
 				'before' => '<a href="$1" class="bbc_link" target="_blank" rel="noopener">',
1857 1857
 				'after' => '</a>',
1858
-				'validate' => function (&$tag, &$data, $disabled)
1858
+				'validate' => function(&$tag, &$data, $disabled)
1859 1859
 				{
1860 1860
 					$scheme = parse_url($data, PHP_URL_SCHEME);
1861 1861
 					if (empty($scheme))
@@ -1901,7 +1901,7 @@  discard block
 block discarded – undo
1901 1901
 		{
1902 1902
 			if (isset($temp_bbc))
1903 1903
 				$bbc_codes = $temp_bbc;
1904
-			usort($codes, function ($a, $b) {
1904
+			usort($codes, function($a, $b) {
1905 1905
 				return strcmp($a['tag'], $b['tag']);
1906 1906
 			});
1907 1907
 			return $codes;
@@ -2117,7 +2117,7 @@  discard block
 block discarded – undo
2117 2117
 										# a run of Unicode domain name characters and a dot
2118 2118
 										[\p{L}\p{M}\p{N}\-.:@]+\.
2119 2119
 										# and then a TLD valid in the DNS or the reserved "local" TLD
2120
-										(?:'. $modSettings['tld_regex'] .'|local)
2120
+										(?:'. $modSettings['tld_regex'] . '|local)
2121 2121
 									)
2122 2122
 									# followed by a non-domain character or end of line
2123 2123
 									(?=[^\p{L}\p{N}\-.]|$)
@@ -2185,7 +2185,7 @@  discard block
 block discarded – undo
2185 2185
 						)?
2186 2186
 						';
2187 2187
 
2188
-						$data = preg_replace_callback('~' . $url_regex . '~xi' . ($context['utf8'] ? 'u' : ''), function ($matches) {
2188
+						$data = preg_replace_callback('~' . $url_regex . '~xi' . ($context['utf8'] ? 'u' : ''), function($matches) {
2189 2189
 							$url = array_shift($matches);
2190 2190
 
2191 2191
 							// If this isn't a clean URL, bail out
@@ -2210,7 +2210,7 @@  discard block
 block discarded – undo
2210 2210
 								$fullUrl = $url;
2211 2211
 
2212 2212
 							// Make sure that $fullUrl really is valid
2213
-							if (validate_iri((strpos($fullUrl, '//') === 0 ? 'http:' : '' ) . $fullUrl) === false)
2213
+							if (validate_iri((strpos($fullUrl, '//') === 0 ? 'http:' : '') . $fullUrl) === false)
2214 2214
 								return $url;
2215 2215
 
2216 2216
 							return '[url=&quot;' . str_replace(array('[', ']'), array('&#91;', '&#93;'), $fullUrl) . '&quot;]' . $url . '[/url]';
@@ -2274,7 +2274,7 @@  discard block
 block discarded – undo
2274 2274
 			$look_for = strtolower(substr($message, $pos + 2, $pos2 - $pos - 2));
2275 2275
 
2276 2276
 			// A closing tag that doesn't match any open tags? Skip it.
2277
-			if (!in_array($look_for, array_map(function($code){return $code['tag'];}, $open_tags)))
2277
+			if (!in_array($look_for, array_map(function($code) {return $code['tag']; }, $open_tags)))
2278 2278
 				continue;
2279 2279
 
2280 2280
 			$to_close = array();
@@ -2932,7 +2932,7 @@  discard block
 block discarded – undo
2932 2932
 		}
2933 2933
 
2934 2934
 		// Set proper extensions; do this post caching so cache doesn't become extension-specific
2935
-		foreach($smileysto AS $ix=>$file)
2935
+		foreach ($smileysto AS $ix=>$file)
2936 2936
 			// Need to use the default if user selection is disabled
2937 2937
 			if (empty($modSettings['smiley_sets_enable']))
2938 2938
 				$smileysto[$ix] = $file . $context['user']['smiley_set_default_ext'];
@@ -2950,7 +2950,7 @@  discard block
 block discarded – undo
2950 2950
 		for ($i = 0, $n = count($smileysfrom); $i < $n; $i++)
2951 2951
 		{
2952 2952
 			$specialChars = $smcFunc['htmlspecialchars']($smileysfrom[$i], ENT_QUOTES);
2953
-			$smileyCode = '<img src="' . $smileys_path . $smileysto[$i] . '" alt="' . strtr($specialChars, array(':' => '&#58;', '(' => '&#40;', ')' => '&#41;', '$' => '&#36;', '[' => '&#091;')). '" title="' . strtr($smcFunc['htmlspecialchars']($smileysdescs[$i]), array(':' => '&#58;', '(' => '&#40;', ')' => '&#41;', '$' => '&#36;', '[' => '&#091;')) . '" class="smiley">';
2953
+			$smileyCode = '<img src="' . $smileys_path . $smileysto[$i] . '" alt="' . strtr($specialChars, array(':' => '&#58;', '(' => '&#40;', ')' => '&#41;', '$' => '&#36;', '[' => '&#091;')) . '" title="' . strtr($smcFunc['htmlspecialchars']($smileysdescs[$i]), array(':' => '&#58;', '(' => '&#40;', ')' => '&#41;', '$' => '&#36;', '[' => '&#091;')) . '" class="smiley">';
2954 2954
 
2955 2955
 			$smileyPregReplacements[$smileysfrom[$i]] = $smileyCode;
2956 2956
 
@@ -2975,7 +2975,7 @@  discard block
 block discarded – undo
2975 2975
 
2976 2976
 	// Replace away!
2977 2977
 	$message = preg_replace_callback($smileyPregSearch,
2978
-		function ($matches) use ($smileyPregReplacements)
2978
+		function($matches) use ($smileyPregReplacements)
2979 2979
 		{
2980 2980
 			return $smileyPregReplacements[$matches[1]];
2981 2981
 		}, $message);
@@ -3072,13 +3072,13 @@  discard block
 block discarded – undo
3072 3072
 	{
3073 3073
 		if (defined('SID') && SID != '')
3074 3074
 			$setLocation = preg_replace_callback('~^' . preg_quote($scripturl, '~') . '\?(?:' . SID . '(?:;|&|&amp;))((?:board|topic)=[^#]+?)(#[^"]*?)?$~',
3075
-				function ($m) use ($scripturl)
3075
+				function($m) use ($scripturl)
3076 3076
 				{
3077
-					return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html?' . SID. (isset($m[2]) ? "$m[2]" : "");
3077
+					return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html?' . SID . (isset($m[2]) ? "$m[2]" : "");
3078 3078
 				}, $setLocation);
3079 3079
 		else
3080 3080
 			$setLocation = preg_replace_callback('~^' . preg_quote($scripturl, '~') . '\?((?:board|topic)=[^#"]+?)(#[^"]*?)?$~',
3081
-				function ($m) use ($scripturl)
3081
+				function($m) use ($scripturl)
3082 3082
 				{
3083 3083
 					return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html' . (isset($m[2]) ? "$m[2]" : "");
3084 3084
 				}, $setLocation);
@@ -3399,7 +3399,7 @@  discard block
 block discarded – undo
3399 3399
 
3400 3400
 	// Add a generic "Are you sure?" confirmation message.
3401 3401
 	addInlineJavaScript('
3402
-	var smf_you_sure =' . JavaScriptEscape($txt['quickmod_confirm']) .';');
3402
+	var smf_you_sure =' . JavaScriptEscape($txt['quickmod_confirm']) . ';');
3403 3403
 
3404 3404
 	// Now add the capping code for avatars.
3405 3405
 	if (!empty($modSettings['avatar_max_width_external']) && !empty($modSettings['avatar_max_height_external']) && !empty($modSettings['avatar_action_too_large']) && $modSettings['avatar_action_too_large'] == 'option_css_resize')
@@ -3865,7 +3865,7 @@  discard block
 block discarded – undo
3865 3865
 	if (!empty($normal))
3866 3866
 		foreach ($normal as $nf)
3867 3867
 			echo '
3868
-	<link rel="stylesheet" href="', $nf ,'">';
3868
+	<link rel="stylesheet" href="', $nf, '">';
3869 3869
 
3870 3870
 	if ($db_show_debug === true)
3871 3871
 	{
@@ -3881,7 +3881,7 @@  discard block
 block discarded – undo
3881 3881
 	<style>';
3882 3882
 
3883 3883
 		foreach ($context['css_header'] as $css)
3884
-			echo $css .'
3884
+			echo $css . '
3885 3885
 	';
3886 3886
 
3887 3887
 		echo'
@@ -3925,7 +3925,7 @@  discard block
 block discarded – undo
3925 3925
 
3926 3926
 
3927 3927
 	// No namespaces, sorry!
3928
-	$classType = 'MatthiasMullie\\Minify\\'. strtoupper($type);
3928
+	$classType = 'MatthiasMullie\\Minify\\' . strtoupper($type);
3929 3929
 
3930 3930
 	// Temp path.
3931 3931
 	$cTempPath = $settings['theme_dir'] . '/' . ($type == 'css' ? 'css' : 'scripts') . '/';
@@ -4105,7 +4105,7 @@  discard block
 block discarded – undo
4105 4105
 	else
4106 4106
 		$path = $modSettings['attachmentUploadDir'];
4107 4107
 
4108
-	return $path . '/' . $attachment_id . '_' . $file_hash .'.dat';
4108
+	return $path . '/' . $attachment_id . '_' . $file_hash . '.dat';
4109 4109
 }
4110 4110
 
4111 4111
 /**
@@ -4149,10 +4149,10 @@  discard block
 block discarded – undo
4149 4149
 		$valid_low = isValidIP($ip_parts[0]);
4150 4150
 		$valid_high = isValidIP($ip_parts[1]);
4151 4151
 		$count = 0;
4152
-		$mode = (preg_match('/:/',$ip_parts[0]) > 0 ? ':' : '.');
4152
+		$mode = (preg_match('/:/', $ip_parts[0]) > 0 ? ':' : '.');
4153 4153
 		$max = ($mode == ':' ? 'ffff' : '255');
4154 4154
 		$min = 0;
4155
-		if(!$valid_low)
4155
+		if (!$valid_low)
4156 4156
 		{
4157 4157
 			$ip_parts[0] = preg_replace('/\*/', '0', $ip_parts[0]);
4158 4158
 			$valid_low = isValidIP($ip_parts[0]);
@@ -4166,7 +4166,7 @@  discard block
 block discarded – undo
4166 4166
 		}
4167 4167
 
4168 4168
 		$count = 0;
4169
-		if(!$valid_high)
4169
+		if (!$valid_high)
4170 4170
 		{
4171 4171
 			$ip_parts[1] = preg_replace('/\*/', $max, $ip_parts[1]);
4172 4172
 			$valid_high = isValidIP($ip_parts[1]);
@@ -4179,7 +4179,7 @@  discard block
 block discarded – undo
4179 4179
 			}
4180 4180
 		}
4181 4181
 
4182
-		if($valid_high && $valid_low)
4182
+		if ($valid_high && $valid_low)
4183 4183
 		{
4184 4184
 			$ip_array['low'] = $ip_parts[0];
4185 4185
 			$ip_array['high'] = $ip_parts[1];
@@ -4360,7 +4360,7 @@  discard block
 block discarded – undo
4360 4360
 		addInlineJavaScript('
4361 4361
 	var user_menus = new smc_PopupMenu();
4362 4362
 	user_menus.add("profile", "' . $scripturl . '?action=profile;area=popup");
4363
-	user_menus.add("alerts", "' . $scripturl . '?action=profile;area=alerts_popup;u='. $context['user']['id'] .'");', true);
4363
+	user_menus.add("alerts", "' . $scripturl . '?action=profile;area=alerts_popup;u=' . $context['user']['id'] . '");', true);
4364 4364
 		if ($context['allow_pm'])
4365 4365
 			addInlineJavaScript('
4366 4366
 	user_menus.add("pm", "' . $scripturl . '?action=pm;sa=popup");', true);
@@ -4655,7 +4655,7 @@  discard block
 block discarded – undo
4655 4655
 		$context['total_admin_reports'] += $context['unapproved_members'];
4656 4656
 	}
4657 4657
 
4658
-	if($context['total_admin_reports'] > 0 && !empty($context['menu_buttons']['admin']))
4658
+	if ($context['total_admin_reports'] > 0 && !empty($context['menu_buttons']['admin']))
4659 4659
 	{
4660 4660
 		$context['menu_buttons']['admin']['amt'] = $context['total_admin_reports'];
4661 4661
 	}
@@ -5002,7 +5002,7 @@  discard block
 block discarded – undo
5002 5002
 		// No? try a fallback to $sourcedir
5003 5003
 		else
5004 5004
 		{
5005
-			$absPath = $sourcedir .'/'. $file;
5005
+			$absPath = $sourcedir . '/' . $file;
5006 5006
 
5007 5007
 			if (file_exists($absPath))
5008 5008
 				require_once($absPath);
@@ -5269,15 +5269,15 @@  discard block
 block discarded – undo
5269 5269
 
5270 5270
 	// UTF-8 occurences of MS special characters
5271 5271
 	$findchars_utf8 = array(
5272
-		"\xe2\x80\x9a",	// single low-9 quotation mark
5273
-		"\xe2\x80\x9e",	// double low-9 quotation mark
5274
-		"\xe2\x80\xa6",	// horizontal ellipsis
5275
-		"\xe2\x80\x98",	// left single curly quote
5276
-		"\xe2\x80\x99",	// right single curly quote
5277
-		"\xe2\x80\x9c",	// left double curly quote
5278
-		"\xe2\x80\x9d",	// right double curly quote
5279
-		"\xe2\x80\x93",	// en dash
5280
-		"\xe2\x80\x94",	// em dash
5272
+		"\xe2\x80\x9a", // single low-9 quotation mark
5273
+		"\xe2\x80\x9e", // double low-9 quotation mark
5274
+		"\xe2\x80\xa6", // horizontal ellipsis
5275
+		"\xe2\x80\x98", // left single curly quote
5276
+		"\xe2\x80\x99", // right single curly quote
5277
+		"\xe2\x80\x9c", // left double curly quote
5278
+		"\xe2\x80\x9d", // right double curly quote
5279
+		"\xe2\x80\x93", // en dash
5280
+		"\xe2\x80\x94", // em dash
5281 5281
 	);
5282 5282
 
5283 5283
 	// windows 1252 / iso equivalents
@@ -5295,15 +5295,15 @@  discard block
 block discarded – undo
5295 5295
 
5296 5296
 	// safe replacements
5297 5297
 	$replacechars = array(
5298
-		',',	// &sbquo;
5299
-		',,',	// &bdquo;
5300
-		'...',	// &hellip;
5301
-		"'",	// &lsquo;
5302
-		"'",	// &rsquo;
5303
-		'"',	// &ldquo;
5304
-		'"',	// &rdquo;
5305
-		'-',	// &ndash;
5306
-		'--',	// &mdash;
5298
+		',', // &sbquo;
5299
+		',,', // &bdquo;
5300
+		'...', // &hellip;
5301
+		"'", // &lsquo;
5302
+		"'", // &rsquo;
5303
+		'"', // &ldquo;
5304
+		'"', // &rdquo;
5305
+		'-', // &ndash;
5306
+		'--', // &mdash;
5307 5307
 	);
5308 5308
 
5309 5309
 	if ($context['utf8'])
@@ -5623,7 +5623,7 @@  discard block
 block discarded – undo
5623 5623
  */
5624 5624
 function inet_dtop($bin)
5625 5625
 {
5626
-	if(empty($bin))
5626
+	if (empty($bin))
5627 5627
 		return '';
5628 5628
 
5629 5629
 	global $db_type;
@@ -5654,28 +5654,28 @@  discard block
 block discarded – undo
5654 5654
  */
5655 5655
 function _safe_serialize($value)
5656 5656
 {
5657
-	if(is_null($value))
5657
+	if (is_null($value))
5658 5658
 		return 'N;';
5659 5659
 
5660
-	if(is_bool($value))
5661
-		return 'b:'. (int) $value .';';
5660
+	if (is_bool($value))
5661
+		return 'b:' . (int) $value . ';';
5662 5662
 
5663
-	if(is_int($value))
5664
-		return 'i:'. $value .';';
5663
+	if (is_int($value))
5664
+		return 'i:' . $value . ';';
5665 5665
 
5666
-	if(is_float($value))
5667
-		return 'd:'. str_replace(',', '.', $value) .';';
5666
+	if (is_float($value))
5667
+		return 'd:' . str_replace(',', '.', $value) . ';';
5668 5668
 
5669
-	if(is_string($value))
5670
-		return 's:'. strlen($value) .':"'. $value .'";';
5669
+	if (is_string($value))
5670
+		return 's:' . strlen($value) . ':"' . $value . '";';
5671 5671
 
5672
-	if(is_array($value))
5672
+	if (is_array($value))
5673 5673
 	{
5674 5674
 		$out = '';
5675
-		foreach($value as $k => $v)
5675
+		foreach ($value as $k => $v)
5676 5676
 			$out .= _safe_serialize($k) . _safe_serialize($v);
5677 5677
 
5678
-		return 'a:'. count($value) .':{'. $out .'}';
5678
+		return 'a:' . count($value) . ':{' . $out . '}';
5679 5679
 	}
5680 5680
 
5681 5681
 	// safe_serialize cannot serialize resources or objects.
@@ -5717,7 +5717,7 @@  discard block
 block discarded – undo
5717 5717
 function _safe_unserialize($str)
5718 5718
 {
5719 5719
 	// Input  is not a string.
5720
-	if(empty($str) || !is_string($str))
5720
+	if (empty($str) || !is_string($str))
5721 5721
 		return false;
5722 5722
 
5723 5723
 	$stack = array();
@@ -5731,40 +5731,40 @@  discard block
 block discarded – undo
5731 5731
 	 *   3 - in array, expecting value or another array
5732 5732
 	 */
5733 5733
 	$state = 0;
5734
-	while($state != 1)
5734
+	while ($state != 1)
5735 5735
 	{
5736 5736
 		$type = isset($str[0]) ? $str[0] : '';
5737
-		if($type == '}')
5737
+		if ($type == '}')
5738 5738
 			$str = substr($str, 1);
5739 5739
 
5740
-		else if($type == 'N' && $str[1] == ';')
5740
+		else if ($type == 'N' && $str[1] == ';')
5741 5741
 		{
5742 5742
 			$value = null;
5743 5743
 			$str = substr($str, 2);
5744 5744
 		}
5745
-		else if($type == 'b' && preg_match('/^b:([01]);/', $str, $matches))
5745
+		else if ($type == 'b' && preg_match('/^b:([01]);/', $str, $matches))
5746 5746
 		{
5747 5747
 			$value = $matches[1] == '1' ? true : false;
5748 5748
 			$str = substr($str, 4);
5749 5749
 		}
5750
-		else if($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches))
5750
+		else if ($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches))
5751 5751
 		{
5752
-			$value = (int)$matches[1];
5752
+			$value = (int) $matches[1];
5753 5753
 			$str = $matches[2];
5754 5754
 		}
5755
-		else if($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches))
5755
+		else if ($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches))
5756 5756
 		{
5757
-			$value = (float)$matches[1];
5757
+			$value = (float) $matches[1];
5758 5758
 			$str = $matches[3];
5759 5759
 		}
5760
-		else if($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int)$matches[1], 2) == '";')
5760
+		else if ($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int) $matches[1], 2) == '";')
5761 5761
 		{
5762
-			$value = substr($matches[2], 0, (int)$matches[1]);
5763
-			$str = substr($matches[2], (int)$matches[1] + 2);
5762
+			$value = substr($matches[2], 0, (int) $matches[1]);
5763
+			$str = substr($matches[2], (int) $matches[1] + 2);
5764 5764
 		}
5765
-		else if($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches))
5765
+		else if ($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches))
5766 5766
 		{
5767
-			$expectedLength = (int)$matches[1];
5767
+			$expectedLength = (int) $matches[1];
5768 5768
 			$str = $matches[2];
5769 5769
 		}
5770 5770
 
@@ -5772,10 +5772,10 @@  discard block
 block discarded – undo
5772 5772
 		else
5773 5773
 			return false;
5774 5774
 
5775
-		switch($state)
5775
+		switch ($state)
5776 5776
 		{
5777 5777
 			case 3: // In array, expecting value or another array.
5778
-				if($type == 'a')
5778
+				if ($type == 'a')
5779 5779
 				{
5780 5780
 					$stack[] = &$list;
5781 5781
 					$list[$key] = array();
@@ -5784,7 +5784,7 @@  discard block
 block discarded – undo
5784 5784
 					$state = 2;
5785 5785
 					break;
5786 5786
 				}
5787
-				if($type != '}')
5787
+				if ($type != '}')
5788 5788
 				{
5789 5789
 					$list[$key] = $value;
5790 5790
 					$state = 2;
@@ -5795,29 +5795,29 @@  discard block
 block discarded – undo
5795 5795
 				return false;
5796 5796
 
5797 5797
 			case 2: // in array, expecting end of array or a key
5798
-				if($type == '}')
5798
+				if ($type == '}')
5799 5799
 				{
5800 5800
 					// Array size is less than expected.
5801
-					if(count($list) < end($expected))
5801
+					if (count($list) < end($expected))
5802 5802
 						return false;
5803 5803
 
5804 5804
 					unset($list);
5805
-					$list = &$stack[count($stack)-1];
5805
+					$list = &$stack[count($stack) - 1];
5806 5806
 					array_pop($stack);
5807 5807
 
5808 5808
 					// Go to terminal state if we're at the end of the root array.
5809 5809
 					array_pop($expected);
5810 5810
 
5811
-					if(count($expected) == 0)
5811
+					if (count($expected) == 0)
5812 5812
 						$state = 1;
5813 5813
 
5814 5814
 					break;
5815 5815
 				}
5816 5816
 
5817
-				if($type == 'i' || $type == 's')
5817
+				if ($type == 'i' || $type == 's')
5818 5818
 				{
5819 5819
 					// Array size exceeds expected length.
5820
-					if(count($list) >= end($expected))
5820
+					if (count($list) >= end($expected))
5821 5821
 						return false;
5822 5822
 
5823 5823
 					$key = $value;
@@ -5830,7 +5830,7 @@  discard block
 block discarded – undo
5830 5830
 
5831 5831
 			// Expecting array or value.
5832 5832
 			case 0:
5833
-				if($type == 'a')
5833
+				if ($type == 'a')
5834 5834
 				{
5835 5835
 					$data = array();
5836 5836
 					$list = &$data;
@@ -5839,7 +5839,7 @@  discard block
 block discarded – undo
5839 5839
 					break;
5840 5840
 				}
5841 5841
 
5842
-				if($type != '}')
5842
+				if ($type != '}')
5843 5843
 				{
5844 5844
 					$data = $value;
5845 5845
 					$state = 1;
@@ -5852,7 +5852,7 @@  discard block
 block discarded – undo
5852 5852
 	}
5853 5853
 
5854 5854
 	// Trailing data in input.
5855
-	if(!empty($str))
5855
+	if (!empty($str))
5856 5856
 		return false;
5857 5857
 
5858 5858
 	return $data;
@@ -5906,7 +5906,7 @@  discard block
 block discarded – undo
5906 5906
 	// Set different modes.
5907 5907
 	$chmodValues = $isDir ? array(0750, 0755, 0775, 0777) : array(0644, 0664, 0666);
5908 5908
 
5909
-	foreach($chmodValues as $val)
5909
+	foreach ($chmodValues as $val)
5910 5910
 	{
5911 5911
 		// If it's writable, break out of the loop.
5912 5912
 		if (is_writable($file))
@@ -5941,13 +5941,13 @@  discard block
 block discarded – undo
5941 5941
 	$returnArray = @json_decode($json, $returnAsArray);
5942 5942
 
5943 5943
 	// PHP 5.3 so no json_last_error_msg()
5944
-	switch(json_last_error())
5944
+	switch (json_last_error())
5945 5945
 	{
5946 5946
 		case JSON_ERROR_NONE:
5947 5947
 			$jsonError = false;
5948 5948
 			break;
5949 5949
 		case JSON_ERROR_DEPTH:
5950
-			$jsonError =  'JSON_ERROR_DEPTH';
5950
+			$jsonError = 'JSON_ERROR_DEPTH';
5951 5951
 			break;
5952 5952
 		case JSON_ERROR_STATE_MISMATCH:
5953 5953
 			$jsonError = 'JSON_ERROR_STATE_MISMATCH';
@@ -5975,10 +5975,10 @@  discard block
 block discarded – undo
5975 5975
 		loadLanguage('Errors');
5976 5976
 
5977 5977
 		if (!empty($jsonDebug))
5978
-			log_error($txt['json_'. $jsonError], 'critical', $jsonDebug['file'], $jsonDebug['line']);
5978
+			log_error($txt['json_' . $jsonError], 'critical', $jsonDebug['file'], $jsonDebug['line']);
5979 5979
 
5980 5980
 		else
5981
-			log_error($txt['json_'. $jsonError], 'critical');
5981
+			log_error($txt['json_' . $jsonError], 'critical');
5982 5982
 
5983 5983
 		// Everyone expects an array.
5984 5984
 		return array();
@@ -6095,7 +6095,7 @@  discard block
 block discarded – undo
6095 6095
 		// Convert Punycode to Unicode
6096 6096
 		require_once($sourcedir . '/Class-Punycode.php');
6097 6097
 		$Punycode = new Punycode();
6098
-		$tlds = array_map(function ($input) use ($Punycode) { return $Punycode->decode($input); }, $tlds);
6098
+		$tlds = array_map(function($input) use ($Punycode) { return $Punycode->decode($input); }, $tlds);
6099 6099
 	}
6100 6100
 	// Otherwise, use the 2012 list of gTLDs and ccTLDs for now and schedule a background update
6101 6101
 	else
@@ -6189,7 +6189,7 @@  discard block
 block discarded – undo
6189 6189
 	}
6190 6190
 
6191 6191
 	// This recursive function creates the index array from the strings
6192
-	$add_string_to_index = function ($string, $index) use (&$strlen, &$substr, &$add_string_to_index)
6192
+	$add_string_to_index = function($string, $index) use (&$strlen, &$substr, &$add_string_to_index)
6193 6193
 	{
6194 6194
 		static $depth = 0;
6195 6195
 		$depth++;
@@ -6216,7 +6216,7 @@  discard block
 block discarded – undo
6216 6216
 	};
6217 6217
 
6218 6218
 	// This recursive function turns the index array into a regular expression
6219
-	$index_to_regex = function (&$index, $delim) use (&$strlen, &$index_to_regex)
6219
+	$index_to_regex = function(&$index, $delim) use (&$strlen, &$index_to_regex)
6220 6220
 	{
6221 6221
 		static $depth = 0;
6222 6222
 		$depth++;
@@ -6240,11 +6240,11 @@  discard block
 block discarded – undo
6240 6240
 
6241 6241
 				if (count(array_keys($value)) == 1)
6242 6242
 				{
6243
-					$new_key_array = explode('(?'.'>', $sub_regex);
6243
+					$new_key_array = explode('(?' . '>', $sub_regex);
6244 6244
 					$new_key .= $new_key_array[0];
6245 6245
 				}
6246 6246
 				else
6247
-					$sub_regex = '(?'.'>' . $sub_regex . ')';
6247
+					$sub_regex = '(?' . '>' . $sub_regex . ')';
6248 6248
 			}
6249 6249
 
6250 6250
 			if ($depth > 1)
@@ -6287,10 +6287,10 @@  discard block
 block discarded – undo
6287 6287
 	{
6288 6288
 		$regex = array();
6289 6289
 		while (!empty($index))
6290
-			$regex[] = '(?'.'>' . $index_to_regex($index, $delim) . ')';
6290
+			$regex[] = '(?' . '>' . $index_to_regex($index, $delim) . ')';
6291 6291
 	}
6292 6292
 	else
6293
-		$regex = '(?'.'>' . $index_to_regex($index, $delim) . ')';
6293
+		$regex = '(?' . '>' . $index_to_regex($index, $delim) . ')';
6294 6294
 
6295 6295
 	// Restore PHP's internal character encoding to whatever it was originally
6296 6296
 	if (!empty($current_encoding))
@@ -6451,8 +6451,8 @@  discard block
 block discarded – undo
6451 6451
 		$query_part['query_see_board'] = '1=1';
6452 6452
 	// Otherwise just the groups in $user_info['groups'].
6453 6453
 	else
6454
-		$query_part['query_see_board'] = 'EXISTS (SELECT DISTINCT bpv.id_board FROM ' . $db_prefix . 'board_permissions_view bpv WHERE (bpv.id_group IN ( '. implode(',', $groups) .') AND bpv.deny = 0) '
6455
-				.  ( !empty($deny_boards_access) ? ' AND (bpv.id_group NOT IN ( '. implode(',', $groups) .') and bpv.deny = 1)' : '')
6454
+		$query_part['query_see_board'] = 'EXISTS (SELECT DISTINCT bpv.id_board FROM ' . $db_prefix . 'board_permissions_view bpv WHERE (bpv.id_group IN ( ' . implode(',', $groups) . ') AND bpv.deny = 0) '
6455
+				.  (!empty($deny_boards_access) ? ' AND (bpv.id_group NOT IN ( ' . implode(',', $groups) . ') and bpv.deny = 1)' : '')
6456 6456
 				. ' AND bpv.id_board = b.id_board)';
6457 6457
 		
6458 6458
 	// Build the list of boards they WANT to see.
@@ -6516,7 +6516,7 @@  discard block
 block discarded – undo
6516 6516
 function sanitize_iri($iri)
6517 6517
 {
6518 6518
 	// Encode any non-ASCII characters (but not space or control characters of any sort)
6519
-	$iri = preg_replace_callback('~[^\x00-\x7F\pZ\pC]~u', function ($matches) {
6519
+	$iri = preg_replace_callback('~[^\x00-\x7F\pZ\pC]~u', function($matches) {
6520 6520
 		return rawurlencode($matches[0]);
6521 6521
 	}, $iri);
6522 6522
 
@@ -6558,7 +6558,7 @@  discard block
 block discarded – undo
6558 6558
 	$unescaped = array(
6559 6559
 		'%21'=>'!', '%23'=>'#', '%24'=>'$', '%26'=>'&',
6560 6560
 		'%27'=>"'", '%28'=>'(', '%29'=>')', '%2A'=>'*',
6561
-		'%2B'=>'+', '%2C'=>',',	'%2F'=>'/', '%3A'=>':',
6561
+		'%2B'=>'+', '%2C'=>',', '%2F'=>'/', '%3A'=>':',
6562 6562
 		'%3B'=>';', '%3D'=>'=', '%3F'=>'?', '%40'=>'@',
6563 6563
 	);
6564 6564
 	$iri = strtr(rawurlencode($iri), $unescaped);
Please login to merge, or discard this patch.