Completed
Pull Request — release-2.1 (#4471)
by Scott
08:27
created
Sources/RepairBoards.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 					LEFT JOIN {db_prefix}topics AS t ON (t.id_topic = m.id_topic)
233 233
 				WHERE t.id_topic IS NULL
234 234
 				GROUP BY m.id_topic, m.id_board',
235
-			'fix_processing' => function ($row) use ($smcFunc)
235
+			'fix_processing' => function($row) use ($smcFunc)
236 236
 			{
237 237
 				global $salvageBoardID;
238 238
 
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 			// Remove all topics that have zero messages in the messages table.
319 319
 			'fix_collect' => array(
320 320
 				'index' => 'id_topic',
321
-				'process' => function ($topics) use ($smcFunc)
321
+				'process' => function($topics) use ($smcFunc)
322 322
 				{
323 323
 					$smcFunc['db_query']('', '
324 324
 						DELETE FROM {db_prefix}topics
@@ -356,21 +356,21 @@  discard block
 block discarded – undo
356 356
 				  AND p.id_poll IS NULL
357 357
 				GROUP BY o.id_poll, t.id_topic, t.id_board, t.id_member_started, m.member_name
358 358
 				  ',
359
-			'fix_processing' => function ($row) use ($smcFunc, $txt)
359
+			'fix_processing' => function($row) use ($smcFunc, $txt)
360 360
 			{
361 361
 				global $salvageBoardID;
362 362
 
363 363
 				$row['poster_name'] = !empty($row['poster_name']) ? $row['poster_name'] : $txt['guest'];
364 364
 				$row['id_poster'] = !empty($row['id_poster']) ? $row['id_poster'] : 0;
365 365
 
366
-				if(empty($row['id_board']))
366
+				if (empty($row['id_board']))
367 367
 				{
368 368
 					// Only if we don't have a reasonable idea of where to put it.
369 369
 					createSalvageArea();
370
-					$row['id_board'] = (int)$salvageBoardID;
370
+					$row['id_board'] = (int) $salvageBoardID;
371 371
 				}
372 372
 
373
-				if(empty($row['id_topic'])) {
373
+				if (empty($row['id_topic'])) {
374 374
 					$newMessageID = $smcFunc['db_insert']('',
375 375
 						'{db_prefix}messages',
376 376
 						array(
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
 					LEFT JOIN {db_prefix}topics AS t ON (t.id_poll = p.id_poll)
493 493
 				WHERE p.id_poll BETWEEN {STEP_LOW} AND {STEP_HIGH}
494 494
 					AND t.id_poll IS NULL',
495
-			'fix_processing' => function ($row) use ($smcFunc, $txt)
495
+			'fix_processing' => function($row) use ($smcFunc, $txt)
496 496
 			{
497 497
 				global $salvageBoardID;
498 498
 
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
 				WHERE t.id_topic BETWEEN {STEP_LOW} AND {STEP_HIGH}
606 606
 				GROUP BY t.id_topic, t.id_first_msg, t.id_last_msg, t.approved, mf.approved
607 607
 				ORDER BY t.id_topic',
608
-			'fix_processing' => function ($row) use ($smcFunc)
608
+			'fix_processing' => function($row) use ($smcFunc)
609 609
 			{
610 610
 				$row['firstmsg_approved'] = (int) $row['firstmsg_approved'];
611 611
 				$row['myid_first_msg'] = (int) $row['myid_first_msg'];
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
 					)
635 635
 				);
636 636
 			},
637
-			'message_function' => function ($row) use ($txt, &$context)
637
+			'message_function' => function($row) use ($txt, &$context)
638 638
 			{
639 639
 				// A pretend error?
640 640
 				if ($row['id_first_msg'] == $row['myid_first_msg'] && $row['id_last_msg'] == $row['myid_last_msg'] && $row['approved'] == $row['firstmsg_approved'])
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
 				WHERE t.id_topic BETWEEN {STEP_LOW} AND {STEP_HIGH}
669 669
 				GROUP BY t.id_topic, t.num_replies, mf.approved
670 670
 				ORDER BY t.id_topic',
671
-			'fix_processing' => function ($row)
671
+			'fix_processing' => function($row)
672 672
 		{
673 673
 
674 674
 				global $smcFunc;
@@ -689,7 +689,7 @@  discard block
 block discarded – undo
689 689
 				);
690 690
 
691 691
 		},
692
-			'message_function' => function ($row)
692
+			'message_function' => function($row)
693 693
 		{
694 694
 
695 695
 				global $txt, $context;
@@ -722,7 +722,7 @@  discard block
 block discarded – undo
722 722
 				GROUP BY t.id_topic, t.unapproved_posts
723 723
 				HAVING unapproved_posts != COUNT(mu.id_msg)
724 724
 				ORDER BY t.id_topic',
725
-			'fix_processing' => function ($row)
725
+			'fix_processing' => function($row)
726 726
 		{
727 727
 
728 728
 				global $smcFunc;
@@ -764,7 +764,7 @@  discard block
 block discarded – undo
764 764
 				WHERE b.id_board IS NULL
765 765
 					AND t.id_topic BETWEEN {STEP_LOW} AND {STEP_HIGH}
766 766
 				GROUP BY t.id_board',
767
-			'fix_processing' => function ($row)
767
+			'fix_processing' => function($row)
768 768
 		{
769 769
 
770 770
 				global $smcFunc, $salvageCatID, $txt;
@@ -813,7 +813,7 @@  discard block
 block discarded – undo
813 813
 				ORDER BY b.id_cat, b.id_board',
814 814
 			'fix_collect' => array(
815 815
 				'index' => 'id_cat',
816
-				'process' => function ($cats)
816
+				'process' => function($cats)
817 817
 				{
818 818
 					global $smcFunc, $salvageCatID;
819 819
 					createSalvageArea();
@@ -849,7 +849,7 @@  discard block
 block discarded – undo
849 849
 			// Last step-make sure all non-guest posters still exist.
850 850
 			'fix_collect' => array(
851 851
 				'index' => 'id_msg',
852
-				'process' => function ($msgs)
852
+				'process' => function($msgs)
853 853
 		{
854 854
 
855 855
 					global $smcFunc;
@@ -878,7 +878,7 @@  discard block
 block discarded – undo
878 878
 				ORDER BY b.id_parent, b.id_board',
879 879
 			'fix_collect' => array(
880 880
 				'index' => 'id_parent',
881
-				'process' => function ($parents)
881
+				'process' => function($parents)
882 882
 				{
883 883
 					global $smcFunc, $salvageBoardID, $salvageCatID;
884 884
 					createSalvageArea();
@@ -912,7 +912,7 @@  discard block
 block discarded – undo
912 912
 					AND p.id_poll IS NULL',
913 913
 			'fix_collect' => array(
914 914
 				'index' => 'id_poll',
915
-				'process' => function ($polls)
915
+				'process' => function($polls)
916 916
 		{
917 917
 
918 918
 					global $smcFunc;
@@ -946,7 +946,7 @@  discard block
 block discarded – undo
946 946
 				ORDER BY cal.id_topic',
947 947
 			'fix_collect' => array(
948 948
 				'index' => 'id_topic',
949
-				'process' => function ($events)
949
+				'process' => function($events)
950 950
 		{
951 951
 
952 952
 					global $smcFunc;
@@ -978,7 +978,7 @@  discard block
 block discarded – undo
978 978
 					AND lt.id_member BETWEEN {STEP_LOW} AND {STEP_HIGH}',
979 979
 			'fix_collect' => array(
980 980
 				'index' => 'id_topic',
981
-				'process' => function ($topics)
981
+				'process' => function($topics)
982 982
 		{
983 983
 
984 984
 					global $smcFunc;
@@ -1010,7 +1010,7 @@  discard block
 block discarded – undo
1010 1010
 				GROUP BY lt.id_member',
1011 1011
 			'fix_collect' => array(
1012 1012
 				'index' => 'id_member',
1013
-				'process' => function ($members)
1013
+				'process' => function($members)
1014 1014
 		{
1015 1015
 
1016 1016
 					global $smcFunc;
@@ -1042,7 +1042,7 @@  discard block
 block discarded – undo
1042 1042
 				GROUP BY lb.id_board',
1043 1043
 			'fix_collect' => array(
1044 1044
 				'index' => 'id_board',
1045
-				'process' => function ($boards)
1045
+				'process' => function($boards)
1046 1046
 		{
1047 1047
 
1048 1048
 					global $smcFunc;
@@ -1074,7 +1074,7 @@  discard block
 block discarded – undo
1074 1074
 				GROUP BY lb.id_member',
1075 1075
 			'fix_collect' => array(
1076 1076
 				'index' => 'id_member',
1077
-				'process' => function ($members) use ($smcFunc)
1077
+				'process' => function($members) use ($smcFunc)
1078 1078
 				{
1079 1079
 					$smcFunc['db_query']('', '
1080 1080
 						DELETE FROM {db_prefix}log_boards
@@ -1103,7 +1103,7 @@  discard block
 block discarded – undo
1103 1103
 				GROUP BY lmr.id_board',
1104 1104
 			'fix_collect' => array(
1105 1105
 				'index' => 'id_board',
1106
-				'process' => function ($boards) use ($smcFunc)
1106
+				'process' => function($boards) use ($smcFunc)
1107 1107
 				{
1108 1108
 					$smcFunc['db_query']('', '
1109 1109
 						DELETE FROM {db_prefix}log_mark_read
@@ -1132,7 +1132,7 @@  discard block
 block discarded – undo
1132 1132
 				GROUP BY lmr.id_member',
1133 1133
 			'fix_collect' => array(
1134 1134
 				'index' => 'id_member',
1135
-				'process' => function ($members) use ($smcFunc)
1135
+				'process' => function($members) use ($smcFunc)
1136 1136
 				{
1137 1137
 					$smcFunc['db_query']('', '
1138 1138
 						DELETE FROM {db_prefix}log_mark_read
@@ -1161,7 +1161,7 @@  discard block
 block discarded – undo
1161 1161
 				GROUP BY pmr.id_pm',
1162 1162
 			'fix_collect' => array(
1163 1163
 				'index' => 'id_pm',
1164
-				'process' => function ($pms) use ($smcFunc)
1164
+				'process' => function($pms) use ($smcFunc)
1165 1165
 				{
1166 1166
 					$smcFunc['db_query']('', '
1167 1167
 						DELETE FROM {db_prefix}pm_recipients
@@ -1191,7 +1191,7 @@  discard block
 block discarded – undo
1191 1191
 				GROUP BY pmr.id_member',
1192 1192
 			'fix_collect' => array(
1193 1193
 				'index' => 'id_member',
1194
-				'process' => function ($members)
1194
+				'process' => function($members)
1195 1195
 		{
1196 1196
 
1197 1197
 					global $smcFunc;
@@ -1223,7 +1223,7 @@  discard block
 block discarded – undo
1223 1223
 					AND mem.id_member IS NULL',
1224 1224
 			'fix_collect' => array(
1225 1225
 				'index' => 'id_pm',
1226
-				'process' => function ($guestMessages)
1226
+				'process' => function($guestMessages)
1227 1227
 		{
1228 1228
 
1229 1229
 					global $smcFunc;
@@ -1255,7 +1255,7 @@  discard block
 block discarded – undo
1255 1255
 				GROUP BY ln.id_member',
1256 1256
 			'fix_collect' => array(
1257 1257
 				'index' => 'id_member',
1258
-				'process' => function ($members) use ($smcFunc)
1258
+				'process' => function($members) use ($smcFunc)
1259 1259
 				{
1260 1260
 					$smcFunc['db_query']('', '
1261 1261
 						DELETE FROM {db_prefix}log_notify
@@ -1282,7 +1282,7 @@  discard block
 block discarded – undo
1282 1282
 					LEFT JOIN {db_prefix}log_search_subjects AS lss ON (lss.id_topic = t.id_topic)
1283 1283
 				WHERE t.id_topic BETWEEN {STEP_LOW} AND {STEP_HIGH}
1284 1284
 					AND lss.id_topic IS NULL',
1285
-			'fix_full_processing' => function ($result)
1285
+			'fix_full_processing' => function($result)
1286 1286
 		{
1287 1287
 
1288 1288
 				global $smcFunc;
@@ -1314,7 +1314,7 @@  discard block
 block discarded – undo
1314 1314
 					);
1315 1315
 
1316 1316
 		},
1317
-			'message_function' => function ($row)
1317
+			'message_function' => function($row)
1318 1318
 		{
1319 1319
 
1320 1320
 				global $txt, $context;
@@ -1344,7 +1344,7 @@  discard block
 block discarded – undo
1344 1344
 					AND t.id_topic IS NULL',
1345 1345
 			'fix_collect' => array(
1346 1346
 				'index' => 'id_topic',
1347
-				'process' => function ($deleteTopics)
1347
+				'process' => function($deleteTopics)
1348 1348
 		{
1349 1349
 
1350 1350
 					global $smcFunc;
@@ -1376,7 +1376,7 @@  discard block
 block discarded – undo
1376 1376
 					AND mem.id_member IS NULL',
1377 1377
 			'fix_collect' => array(
1378 1378
 				'index' => 'id_member',
1379
-				'process' => function ($members)
1379
+				'process' => function($members)
1380 1380
 		{
1381 1381
 
1382 1382
 					global $smcFunc;
@@ -1407,7 +1407,7 @@  discard block
 block discarded – undo
1407 1407
 					AND p.id_poll IS NULL',
1408 1408
 			'fix_collect' => array(
1409 1409
 				'index' => 'id_poll',
1410
-				'process' => function ($polls)
1410
+				'process' => function($polls)
1411 1411
 		{
1412 1412
 
1413 1413
 					global $smcFunc;
@@ -1438,7 +1438,7 @@  discard block
 block discarded – undo
1438 1438
 					AND lrc.id_report IS NULL',
1439 1439
 			'fix_collect' => array(
1440 1440
 				'index' => 'id_report',
1441
-				'process' => function ($reports)
1441
+				'process' => function($reports)
1442 1442
 		{
1443 1443
 
1444 1444
 					global $smcFunc;
@@ -1469,7 +1469,7 @@  discard block
 block discarded – undo
1469 1469
 					AND lr.id_report IS NULL',
1470 1470
 			'fix_collect' => array(
1471 1471
 				'index' => 'id_report',
1472
-				'process' => function ($reports)
1472
+				'process' => function($reports)
1473 1473
 				{
1474 1474
 					global $smcFunc;
1475 1475
 					$smcFunc['db_query']('', '
@@ -1499,7 +1499,7 @@  discard block
 block discarded – undo
1499 1499
 				GROUP BY lgr.id_member',
1500 1500
 			'fix_collect' => array(
1501 1501
 				'index' => 'id_member',
1502
-				'process' => function ($members)
1502
+				'process' => function($members)
1503 1503
 				{
1504 1504
 					global $smcFunc;
1505 1505
 					$smcFunc['db_query']('', '
@@ -1529,7 +1529,7 @@  discard block
 block discarded – undo
1529 1529
 				GROUP BY lgr.id_group',
1530 1530
 			'fix_collect' => array(
1531 1531
 				'index' => 'id_group',
1532
-				'process' => function ($groups)
1532
+				'process' => function($groups)
1533 1533
 				{
1534 1534
 					global $smcFunc;
1535 1535
 					$smcFunc['db_query']('', '
Please login to merge, or discard this patch.
Themes/default/index.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -232,7 +232,7 @@
 block discarded – undo
232 232
 			// In maintenance mode, only login is allowed and don't show OverlayDiv
233 233
 			echo '
234 234
 			<ul class="floatleft welcome">
235
-				<li>', sprintf($txt['welcome_guest'], $txt['guest_title'], '', $scripturl. '?action=login', 'return true;'), '</li>
235
+				<li>', sprintf($txt['welcome_guest'], $txt['guest_title'], '', $scripturl . '?action=login', 'return true;'), '</li>
236 236
 			</ul>';
237 237
 
238 238
 	if (!empty($modSettings['userLanguage']) && !empty($context['languages']) && count($context['languages']) > 1)
Please login to merge, or discard this patch.
Themes/default/Admin.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -945,7 +945,7 @@
 block discarded – undo
945 945
 				}
946 946
 
947 947
 				echo isset($config_var['postinput']) ? '
948
-											' . $config_var['postinput'] : '','
948
+											' . $config_var['postinput'] : '', '
949 949
 									</dd>';
950 950
 			}
951 951
 		}
Please login to merge, or discard this patch.
Sources/Errors.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
 	$error_call++;
40 40
 
41 41
 	// are we in a loop?
42
-	if($error_call > 2)
42
+	if ($error_call > 2)
43 43
 	{
44 44
 		if (!isset($db_show_debug) || $db_show_debug === false)
45 45
 			$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
Please login to merge, or discard this patch.
Themes/default/Profile.template.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3078,8 +3078,7 @@
 block discarded – undo
3078 3078
 			<div class="roundframe">
3079 3079
 				<div>
3080 3080
 		', !empty($context['tfa_backup']) ? '
3081
-					<div class="smalltext error">' . $txt['tfa_backup_used_desc'] . '</div>' :
3082
-			($modSettings['tfa_mode'] == 2 ? '
3081
+					<div class="smalltext error">' . $txt['tfa_backup_used_desc'] . '</div>' : ($modSettings['tfa_mode'] == 2 ? '
3083 3082
 									<div class="smalltext"><strong>' . $txt['tfa_forced_desc'] . '</strong></div>' : ''), '
3084 3083
 									<div class="smalltext">', $txt['tfa_desc'], '</div>
3085 3084
 									<div class="floatleft">
Please login to merge, or discard this patch.
Themes/default/Post.template.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -417,8 +417,8 @@  discard block
 block discarded – undo
417 417
 									</div><!-- .attached_BBC -->
418 418
 									<div class="progressBar" role="progressBar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></div>
419 419
 									<div class="attach-ui">
420
-										<a data-dz-remove class="button cancel">', $txt['modify_cancel'] ,'</a>
421
-										<a class="button upload">', $txt['upload'] ,'</a>
420
+										<a data-dz-remove class="button cancel">', $txt['modify_cancel'], '</a>
421
+										<a class="button upload">', $txt['upload'], '</a>
422 422
 									</div>
423 423
 								</div><!-- .attach-info -->
424 424
 							</div><!-- #au-template -->
@@ -433,10 +433,10 @@  discard block
 block discarded – undo
433 433
 							</dt>
434 434
 							<dd class="smalltext fallback">
435 435
 								<div id="attachUpload" class="descbox">
436
-									<h5>', $txt['attach_drop_zone'] ,'</h5>
437
-									<a class="button" id="attach-cancelAll">', $txt['attached_cancelAll'] ,'</a>
438
-									<a class="button" id="attach-uploadAll">', $txt['attached_uploadAll'] ,'</a>
439
-									<a class="button fileinput-button">', $txt['attach_add'] ,'</a>
436
+									<h5>', $txt['attach_drop_zone'], '</h5>
437
+									<a class="button" id="attach-cancelAll">', $txt['attached_cancelAll'], '</a>
438
+									<a class="button" id="attach-uploadAll">', $txt['attached_uploadAll'], '</a>
439
+									<a class="button fileinput-button">', $txt['attach_add'], '</a>
440 440
 									<div id="total-progress" class="progressBar" role="progressBar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></div>
441 441
 									<div class="fallback">
442 442
 										<input type="file" multiple="multiple" name="attachment[]" id="attachment1" class="fallback"> (<a href="javascript:void(0);" onclick="cleanFileInput(\'attachment1\');">', $txt['clean_attach'], '</a>)
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
 	// Option to delete an event if user is editing one.
542 542
 	if ($context['make_event'] && !$context['event']['new'])
543 543
 		echo '
544
-						<input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button you_sure">';
544
+						<input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'], '" class="button you_sure">';
545 545
 
546 546
 	echo '
547 547
 					</span>
@@ -795,7 +795,7 @@  discard block
 block discarded – undo
795 795
 			});';
796 796
 
797 797
 	echo '
798
-			var oEditorID = "', $context['post_box_name'] ,'";
798
+			var oEditorID = "', $context['post_box_name'], '";
799 799
 			var oEditorObject = oEditorHandle_', $context['post_box_name'], ';
800 800
 		</script>';
801 801
 
@@ -827,7 +827,7 @@  discard block
 block discarded – undo
827 827
 			if ($context['can_quote'])
828 828
 				echo '
829 829
 					<ul class="quickbuttons" id="msg_', $post['id'], '_quote">
830
-						<li style="display:none;" id="quoteSelected_', $post['id'], '" data-msgid="', $post['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'] ,'</a></li>
830
+						<li style="display:none;" id="quoteSelected_', $post['id'], '" data-msgid="', $post['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'], '</a></li>
831 831
 						<li id="post_modify"><a href="#postmodify" onclick="return insertQuoteFast(', $post['id'], ');"><span class="generic_icons quote"></span>', $txt['quote'], '</a></li>
832 832
 					</ul>';
833 833
 
@@ -911,7 +911,7 @@  discard block
 block discarded – undo
911 911
 	<head>
912 912
 		<meta charset="', $context['character_set'], '">
913 913
 		<title>', $txt['spell_check'], '</title>
914
-		<link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'] ,'">
914
+		<link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'], '">
915 915
 		<style>
916 916
 			body, td {
917 917
 				font-size: small;
@@ -941,8 +941,8 @@  discard block
 block discarded – undo
941 941
 			var spell_formname = window.opener.spell_formname;
942 942
 			var spell_fieldname = window.opener.spell_fieldname;
943 943
 		</script>
944
-		<script src="', $settings['default_theme_url'], '/scripts/spellcheck.js', $modSettings['browser_cache'] ,'"></script>
945
-		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script>
944
+		<script src="', $settings['default_theme_url'], '/scripts/spellcheck.js', $modSettings['browser_cache'], '"></script>
945
+		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script>
946 946
 		<script>
947 947
 			', $context['spell_js'], '
948 948
 		</script>
@@ -986,7 +986,7 @@  discard block
 block discarded – undo
986 986
 	<head>
987 987
 		<meta charset="', $context['character_set'], '">
988 988
 		<title>', $txt['retrieving_quote'], '</title>
989
-		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script>
989
+		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script>
990 990
 	</head>
991 991
 	<body>
992 992
 		', $txt['retrieving_quote'], '
Please login to merge, or discard this patch.
Themes/default/PersonalMessage.template.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 
232 232
 				foreach ($message['custom_fields']['above_member'] as $custom)
233 233
 					echo '
234
-							<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
234
+							<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
235 235
 
236 236
 				echo '
237 237
 						</ul>
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 			if (!empty($message['custom_fields']['below_avatar']))
267 267
 				foreach ($message['custom_fields']['below_avatar'] as $custom)
268 268
 					echo '
269
-						<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
269
+						<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
270 270
 
271 271
 			if (!$message['member']['is_guest'])
272 272
 				echo '
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 
309 309
 					foreach ($message['custom_fields']['icons'] as $custom)
310 310
 						echo '
311
-								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
311
+								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
312 312
 
313 313
 					echo '
314 314
 							</ol>
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 				if (!empty($message['custom_fields']['standard']))
373 373
 					foreach ($message['custom_fields']['standard'] as $custom)
374 374
 						echo '
375
-						<li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>';
375
+						<li class="custom ', $custom['col_name'], '">', $custom['title'], ': ', $custom['value'], '</li>';
376 376
 
377 377
 				// Are we showing the warning status?
378 378
 				if ($message['member']['can_see_warning'])
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 				if (!empty($message['custom_fields']['bottom_poster']))
384 384
 					foreach ($message['custom_fields']['bottom_poster'] as $custom)
385 385
 						echo '
386
-						<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
386
+						<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
387 387
 			}
388 388
 
389 389
 			// Done with the information about the poster... on to the post itself.
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
 
485 485
 				foreach ($message['custom_fields']['above_signature'] as $custom)
486 486
 					echo '
487
-								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
487
+								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
488 488
 
489 489
 				echo '
490 490
 							</ul>
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
 
508 508
 				foreach ($message['custom_fields']['below_signature'] as $custom)
509 509
 					echo '
510
-								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
510
+								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
511 511
 
512 512
 				echo '
513 513
 							</ul>
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
 	while ($message = $context['get_pmessage']('subject'))
644 644
 	{
645 645
 		echo '
646
-			<tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '','">
646
+			<tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '', '">
647 647
 				<td class="table_icon">
648 648
 					<script>
649 649
 						currentLabels[', $message['id'], '] = {';
@@ -922,13 +922,13 @@  discard block
 block discarded – undo
922 922
 				// You can only reply if they are not a guest...
923 923
 				if (!$message['member']['is_guest'])
924 924
 					echo '
925
-					<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'], '
926
-					<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'];
925
+					<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'], '
926
+					<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'];
927 927
 
928 928
 				// This is for "forwarding" - even if the member is gone.
929 929
 				else
930 930
 					echo '
931
-					<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'];
931
+					<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'];
932 932
 			}
933 933
 
934 934
 			echo '
@@ -1031,7 +1031,7 @@  discard block
 block discarded – undo
1031 1031
 				<div class="', empty($context['error_type']) || $context['error_type'] != 'serious' ? 'noticebox' : 'errorbox', '"', empty($context['post_error']['messages']) ? ' style="display: none"' : '', ' id="errors">
1032 1032
 					<dl>
1033 1033
 						<dt>
1034
-							<strong id="error_serious">', $txt['error_while_submitting'] , '</strong>
1034
+							<strong id="error_serious">', $txt['error_while_submitting'], '</strong>
1035 1035
 						</dt>
1036 1036
 						<dd class="error" id="error_list">
1037 1037
 							', empty($context['post_error']['messages']) ? '' : implode('<br>', $context['post_error']['messages']), '
@@ -1087,7 +1087,7 @@  discard block
 block discarded – undo
1087 1087
 						<span', (isset($context['post_error']['no_subject']) ? ' class="error"' : ''), ' id="caption_subject">', $txt['subject'], ':</span>
1088 1088
 					</dt>
1089 1089
 					<dd id="pm_subject">
1090
-						<input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"',isset($context['post_error']['no_subject']) ? ' class="error"' : '', '>
1090
+						<input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"', isset($context['post_error']['no_subject']) ? ' class="error"' : '', '>
1091 1091
 					</dd>
1092 1092
 				</dl>
1093 1093
 				<hr>';
@@ -1452,7 +1452,7 @@  discard block
 block discarded – undo
1452 1452
 		echo '
1453 1453
 		<div class="padding">
1454 1454
 			<input type="submit" name="save" value="', $txt['save'], '" class="button">
1455
-			<input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'] ,'" class="button you_sure">
1455
+			<input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'], '" class="button you_sure">
1456 1456
 		</div>';
1457 1457
 
1458 1458
 	echo '
@@ -1617,7 +1617,7 @@  discard block
 block discarded – undo
1617 1617
 	if (!empty($context['rules']))
1618 1618
 		echo '
1619 1619
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
1620
-			<input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'] ,'" class="button smalltext you_sure">';
1620
+			<input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'], '" class="button smalltext you_sure">';
1621 1621
 
1622 1622
 	echo '
1623 1623
 		</div>
@@ -1860,9 +1860,9 @@  discard block
 block discarded – undo
1860 1860
 
1861 1861
 		echo '
1862 1862
 				<select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();">
1863
-					<option value="">', $txt['pm_rule_sel_action'] , ':</option>
1864
-					<option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'] , '</option>
1865
-					<option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'] , '</option>
1863
+					<option value="">', $txt['pm_rule_sel_action'], ':</option>
1864
+					<option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'], '</option>
1865
+					<option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'], '</option>
1866 1866
 				</select>
1867 1867
 				<span id="labdiv', $k, '">
1868 1868
 					<select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();">
@@ -1974,7 +1974,7 @@  discard block
 block discarded – undo
1974 1974
 			</div>
1975 1975
 			<ul class="quickbuttons">
1976 1976
 				<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>
1977
-				<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>
1977
+				<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>
1978 1978
 			</ul>
1979 1979
 		</div><!-- .windowbg -->';
1980 1980
 		}
Please login to merge, or discard this patch.
Sources/ManageSmileys.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 					'class' => 'centercol',
394 394
 				),
395 395
 				'data' => array(
396
-					'function' => function ($rowData)
396
+					'function' => function($rowData)
397 397
 					{
398 398
 						return $rowData['selected'] ? '<span class="generic_icons valid"></span>' : '';
399 399
 					},
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 					'class' => 'centercol',
454 454
 				),
455 455
 				'data' => array(
456
-					'function' => function ($rowData)
456
+					'function' => function($rowData)
457 457
 					{
458 458
 						return $rowData['selected'] ? '' : sprintf('<input type="checkbox" name="smiley_set[%1$d]">', $rowData['id']);
459 459
 					},
@@ -997,7 +997,7 @@  discard block
 block discarded – undo
997 997
 						'value' => $txt['smileys_location'],
998 998
 					),
999 999
 					'data' => array(
1000
-						'function' => function ($rowData) use ($txt)
1000
+						'function' => function($rowData) use ($txt)
1001 1001
 						{
1002 1002
 							if (empty($rowData['hidden']))
1003 1003
 								return $txt['smileys_location_form'];
@@ -1008,7 +1008,7 @@  discard block
 block discarded – undo
1008 1008
 						},
1009 1009
 					),
1010 1010
 					'sort' => array(
1011
-						'default' => $smcFunc['db_custom_order']('hidden', array_keys($smiley_locations)) ,
1011
+						'default' => $smcFunc['db_custom_order']('hidden', array_keys($smiley_locations)),
1012 1012
 						'reverse' => $smcFunc['db_custom_order']('hidden', array_keys($smiley_locations), true),
1013 1013
 					),
1014 1014
 				),
@@ -1017,7 +1017,7 @@  discard block
 block discarded – undo
1017 1017
 						'value' => $txt['smileys_description'],
1018 1018
 					),
1019 1019
 					'data' => array(
1020
-						'function' => function ($rowData) use ($context, $txt, $modSettings, $smcFunc)
1020
+						'function' => function($rowData) use ($context, $txt, $modSettings, $smcFunc)
1021 1021
 						{
1022 1022
 							if (empty($modSettings['smileys_dir']) || !is_dir($modSettings['smileys_dir']))
1023 1023
 								return $smcFunc['htmlspecialchars']($rowData['description']);
@@ -1554,7 +1554,7 @@  discard block
 block discarded – undo
1554 1554
 				'action' => $smcFunc['htmlspecialchars'](strtr($action['destination'], array($boarddir => '.')))
1555 1555
 			);
1556 1556
 
1557
-			$file =  $packagesdir . '/temp/' . $base_path . $action['filename'];
1557
+			$file = $packagesdir . '/temp/' . $base_path . $action['filename'];
1558 1558
 			if (isset($action['filename']) && (!file_exists($file) || !is_writable(dirname($action['destination']))))
1559 1559
 			{
1560 1560
 				$context['has_failure'] = true;
@@ -1599,7 +1599,7 @@  discard block
 block discarded – undo
1599 1599
 		{
1600 1600
 			updateSettings(array(
1601 1601
 				'smiley_sets_known' => $modSettings['smiley_sets_known'] . ',' . basename($action['action']),
1602
-				'smiley_sets_names' => $modSettings['smiley_sets_names'] . "\n" . $smileyInfo['name'] . (count($context['actions']) > 1 ? ' ' .  (!empty($action['description']) ? $smcFunc['htmlspecialchars']($action['description']) : basename($action['action'])) : ''),
1602
+				'smiley_sets_names' => $modSettings['smiley_sets_names'] . "\n" . $smileyInfo['name'] . (count($context['actions']) > 1 ? ' ' . (!empty($action['description']) ? $smcFunc['htmlspecialchars']($action['description']) : basename($action['action'])) : ''),
1603 1603
 			));
1604 1604
 		}
1605 1605
 
@@ -1611,7 +1611,7 @@  discard block
 block discarded – undo
1611 1611
 			'{db_prefix}log_packages',
1612 1612
 			array(
1613 1613
 				'filename' => 'string', 'name' => 'string', 'package_id' => 'string', 'version' => 'string',
1614
-				'id_member_installed' => 'int', 'member_installed' => 'string','time_installed' => 'int',
1614
+				'id_member_installed' => 'int', 'member_installed' => 'string', 'time_installed' => 'int',
1615 1615
 				'install_state' => 'int', 'failed_steps' => 'string', 'themes_installed' => 'string',
1616 1616
 				'member_removed' => 'int', 'db_changes' => 'string', 'credits' => 'string',
1617 1617
 			),
@@ -1860,7 +1860,7 @@  discard block
 block discarded – undo
1860 1860
 		'columns' => array(
1861 1861
 			'icon' => array(
1862 1862
 				'data' => array(
1863
-					'function' => function ($rowData) use ($settings, $smcFunc)
1863
+					'function' => function($rowData) use ($settings, $smcFunc)
1864 1864
 					{
1865 1865
 						$images_url = $settings[file_exists(sprintf('%1$s/images/post/%2$s.png', $settings['theme_dir'], $rowData['filename'])) ? 'actual_images_url' : 'default_images_url'];
1866 1866
 						return sprintf('<img src="%1$s/post/%2$s.png" alt="%3$s">', $images_url, $rowData['filename'], $smcFunc['htmlspecialchars']($rowData['title']));
@@ -1894,7 +1894,7 @@  discard block
 block discarded – undo
1894 1894
 					'value' => $txt['icons_board'],
1895 1895
 				),
1896 1896
 				'data' => array(
1897
-					'function' => function ($rowData) use ($txt)
1897
+					'function' => function($rowData) use ($txt)
1898 1898
 					{
1899 1899
 						return empty($rowData['board_name']) ? $txt['icons_edit_icons_all_boards'] : $rowData['board_name'];
1900 1900
 					},
Please login to merge, or discard this patch.
Sources/Subs.php 1 patch
Spacing   +120 added lines, -120 removed lines patch added patch discarded remove patch
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
 			{
387 387
 				$val = 'CASE ';
388 388
 				foreach ($members as $k => $v)
389
-					$val .= 'WHEN id_member = ' . $v . ' THEN '. count(fetch_alerts($v, false, 0, array(), false)) . ' ';
389
+					$val .= 'WHEN id_member = ' . $v . ' THEN ' . count(fetch_alerts($v, false, 0, array(), false)) . ' ';
390 390
 				$val = $val . ' END';
391 391
 				$type = 'raw';
392 392
 			}
@@ -817,7 +817,7 @@  discard block
 block discarded – undo
817 817
 			$unsupportedFormats = (array) cache_get_data('unsupportedtimeformats', 86400);
818 818
 		if (empty($unsupportedFormats))
819 819
 		{
820
-			foreach($strftimeFormatSubstitutions as $format => $substitution)
820
+			foreach ($strftimeFormatSubstitutions as $format => $substitution)
821 821
 			{
822 822
 				$value = @strftime('%' . $format);
823 823
 
@@ -1182,7 +1182,7 @@  discard block
 block discarded – undo
1182 1182
 					'height' => array('optional' => true, 'match' => '(\d+)'),
1183 1183
 				),
1184 1184
 				'content' => '$1',
1185
-				'validate' => function (&$tag, &$data, $disabled, $params) use ($modSettings, $context, $sourcedir, $txt)
1185
+				'validate' => function(&$tag, &$data, $disabled, $params) use ($modSettings, $context, $sourcedir, $txt)
1186 1186
 				{
1187 1187
 					$returnContext = '';
1188 1188
 
@@ -1217,7 +1217,7 @@  discard block
 block discarded – undo
1217 1217
 						}
1218 1218
 
1219 1219
 						if ($currentAttachment['thumbnail']['has_thumb'] && empty($params['{width}']) && empty($params['{height}']))
1220
-							$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>';
1220
+							$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>';
1221 1221
 						else
1222 1222
 							$returnContext .= '<img src="' . $currentAttachment['href'] . ';image"' . $alt . $title . $width . $height . ' class="bbc_img"/>';
1223 1223
 					}
@@ -1246,7 +1246,7 @@  discard block
 block discarded – undo
1246 1246
 				'type' => 'unparsed_content',
1247 1247
 				'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>',
1248 1248
 				// @todo Maybe this can be simplified?
1249
-				'validate' => isset($disabled['code']) ? null : function (&$tag, &$data, $disabled) use ($context)
1249
+				'validate' => isset($disabled['code']) ? null : function(&$tag, &$data, $disabled) use ($context)
1250 1250
 				{
1251 1251
 					if (!isset($disabled['code']))
1252 1252
 					{
@@ -1283,7 +1283,7 @@  discard block
 block discarded – undo
1283 1283
 				'type' => 'unparsed_equals_content',
1284 1284
 				'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>',
1285 1285
 				// @todo Maybe this can be simplified?
1286
-				'validate' => isset($disabled['code']) ? null : function (&$tag, &$data, $disabled) use ($context)
1286
+				'validate' => isset($disabled['code']) ? null : function(&$tag, &$data, $disabled) use ($context)
1287 1287
 				{
1288 1288
 					if (!isset($disabled['code']))
1289 1289
 					{
@@ -1327,7 +1327,7 @@  discard block
 block discarded – undo
1327 1327
 				'type' => 'unparsed_content',
1328 1328
 				'content' => '<a href="mailto:$1" class="bbc_email">$1</a>',
1329 1329
 				// @todo Should this respect guest_hideContacts?
1330
-				'validate' => function (&$tag, &$data, $disabled)
1330
+				'validate' => function(&$tag, &$data, $disabled)
1331 1331
 				{
1332 1332
 					$data = strtr($data, array('<br>' => ''));
1333 1333
 				},
@@ -1346,7 +1346,7 @@  discard block
 block discarded – undo
1346 1346
 				'type' => 'unparsed_commas_content',
1347 1347
 				'test' => '\d+,\d+\]',
1348 1348
 				'content' => '<embed type="application/x-shockwave-flash" src="$1" width="$2" height="$3" play="true" loop="true" quality="high" AllowScriptAccess="never">',
1349
-				'validate' => function (&$tag, &$data, $disabled)
1349
+				'validate' => function(&$tag, &$data, $disabled)
1350 1350
 				{
1351 1351
 					if (isset($disabled['url']))
1352 1352
 						$tag['content'] = '$1';
@@ -1362,7 +1362,7 @@  discard block
 block discarded – undo
1362 1362
 				'test' => '(left|right)(\s+max=\d+(?:%|px|em|rem|ex|pt|pc|ch|vw|vh|vmin|vmax|cm|mm|in)?)?\]',
1363 1363
 				'before' => '<div $1>',
1364 1364
 				'after' => '</div>',
1365
-				'validate' => function (&$tag, &$data, $disabled)
1365
+				'validate' => function(&$tag, &$data, $disabled)
1366 1366
 				{
1367 1367
 					$class = 'class="bbc_float float' . (strpos($data, 'left') === 0 ? 'left' : 'right') . '"';
1368 1368
 
@@ -1411,7 +1411,7 @@  discard block
 block discarded – undo
1411 1411
 					'height' => array('optional' => true, 'value' => ' height="$1"', 'match' => '(\d+)'),
1412 1412
 				),
1413 1413
 				'content' => '<img src="$1" alt="{alt}" title="{title}"{width}{height} class="bbc_img resized">',
1414
-				'validate' => function (&$tag, &$data, $disabled)
1414
+				'validate' => function(&$tag, &$data, $disabled)
1415 1415
 				{
1416 1416
 					global $image_proxy_enabled, $image_proxy_secret, $boardurl;
1417 1417
 
@@ -1434,7 +1434,7 @@  discard block
 block discarded – undo
1434 1434
 				'tag' => 'img',
1435 1435
 				'type' => 'unparsed_content',
1436 1436
 				'content' => '<img src="$1" alt="" class="bbc_img">',
1437
-				'validate' => function (&$tag, &$data, $disabled)
1437
+				'validate' => function(&$tag, &$data, $disabled)
1438 1438
 				{
1439 1439
 					global $image_proxy_enabled, $image_proxy_secret, $boardurl;
1440 1440
 
@@ -1457,7 +1457,7 @@  discard block
 block discarded – undo
1457 1457
 				'tag' => 'iurl',
1458 1458
 				'type' => 'unparsed_content',
1459 1459
 				'content' => '<a href="$1" class="bbc_link">$1</a>',
1460
-				'validate' => function (&$tag, &$data, $disabled)
1460
+				'validate' => function(&$tag, &$data, $disabled)
1461 1461
 				{
1462 1462
 					$data = strtr($data, array('<br>' => ''));
1463 1463
 					$scheme = parse_url($data, PHP_URL_SCHEME);
@@ -1471,7 +1471,7 @@  discard block
 block discarded – undo
1471 1471
 				'quoted' => 'optional',
1472 1472
 				'before' => '<a href="$1" class="bbc_link">',
1473 1473
 				'after' => '</a>',
1474
-				'validate' => function (&$tag, &$data, $disabled)
1474
+				'validate' => function(&$tag, &$data, $disabled)
1475 1475
 				{
1476 1476
 					if (substr($data, 0, 1) == '#')
1477 1477
 						$data = '#post_' . substr($data, 1);
@@ -1551,7 +1551,7 @@  discard block
 block discarded – undo
1551 1551
 				'tag' => 'php',
1552 1552
 				'type' => 'unparsed_content',
1553 1553
 				'content' => '<span class="phpcode">$1</span>',
1554
-				'validate' => isset($disabled['php']) ? null : function (&$tag, &$data, $disabled)
1554
+				'validate' => isset($disabled['php']) ? null : function(&$tag, &$data, $disabled)
1555 1555
 				{
1556 1556
 					if (!isset($disabled['php']))
1557 1557
 					{
@@ -1649,7 +1649,7 @@  discard block
 block discarded – undo
1649 1649
 				'test' => '[1-7]\]',
1650 1650
 				'before' => '<span style="font-size: $1;" class="bbc_size">',
1651 1651
 				'after' => '</span>',
1652
-				'validate' => function (&$tag, &$data, $disabled)
1652
+				'validate' => function(&$tag, &$data, $disabled)
1653 1653
 				{
1654 1654
 					$sizes = array(1 => 0.7, 2 => 1.0, 3 => 1.35, 4 => 1.45, 5 => 2.0, 6 => 2.65, 7 => 3.95);
1655 1655
 					$data = $sizes[$data] . 'em';
@@ -1687,7 +1687,7 @@  discard block
 block discarded – undo
1687 1687
 				'tag' => 'time',
1688 1688
 				'type' => 'unparsed_content',
1689 1689
 				'content' => '$1',
1690
-				'validate' => function (&$tag, &$data, $disabled)
1690
+				'validate' => function(&$tag, &$data, $disabled)
1691 1691
 				{
1692 1692
 					if (is_numeric($data))
1693 1693
 						$data = timeformat($data);
@@ -1715,7 +1715,7 @@  discard block
 block discarded – undo
1715 1715
 				'tag' => 'url',
1716 1716
 				'type' => 'unparsed_content',
1717 1717
 				'content' => '<a href="$1" class="bbc_link" target="_blank" rel="noopener">$1</a>',
1718
-				'validate' => function (&$tag, &$data, $disabled)
1718
+				'validate' => function(&$tag, &$data, $disabled)
1719 1719
 				{
1720 1720
 					$data = strtr($data, array('<br>' => ''));
1721 1721
 					$scheme = parse_url($data, PHP_URL_SCHEME);
@@ -1729,7 +1729,7 @@  discard block
 block discarded – undo
1729 1729
 				'quoted' => 'optional',
1730 1730
 				'before' => '<a href="$1" class="bbc_link" target="_blank" rel="noopener">',
1731 1731
 				'after' => '</a>',
1732
-				'validate' => function (&$tag, &$data, $disabled)
1732
+				'validate' => function(&$tag, &$data, $disabled)
1733 1733
 				{
1734 1734
 					$scheme = parse_url($data, PHP_URL_SCHEME);
1735 1735
 					if (empty($scheme))
@@ -1755,7 +1755,7 @@  discard block
 block discarded – undo
1755 1755
 		{
1756 1756
 			if (isset($temp_bbc))
1757 1757
 				$bbc_codes = $temp_bbc;
1758
-			usort($codes, function ($a, $b) {
1758
+			usort($codes, function($a, $b) {
1759 1759
 				return strcmp($a['tag'], $b['tag']);
1760 1760
 			});
1761 1761
 			return $codes;
@@ -1992,7 +1992,7 @@  discard block
 block discarded – undo
1992 1992
 										# a run of Unicode domain name characters and a dot
1993 1993
 										[\p{L}\p{M}\p{N}\-.:@]+\.
1994 1994
 										# and then a TLD valid in the DNS or the reserved "local" TLD
1995
-										(?:'. $modSettings['tld_regex'] .'|local)
1995
+										(?:'. $modSettings['tld_regex'] . '|local)
1996 1996
 									)
1997 1997
 									# followed by a non-domain character or end of line
1998 1998
 									(?=[^\p{L}\p{N}\-.]|$)
@@ -2060,7 +2060,7 @@  discard block
 block discarded – undo
2060 2060
 						)?
2061 2061
 						';
2062 2062
 
2063
-						$data = preg_replace_callback('~' . $url_regex . '~xi' . ($context['utf8'] ? 'u' : ''), function ($matches) {
2063
+						$data = preg_replace_callback('~' . $url_regex . '~xi' . ($context['utf8'] ? 'u' : ''), function($matches) {
2064 2064
 							$url = array_shift($matches);
2065 2065
 
2066 2066
 							$scheme = parse_url($url, PHP_URL_SCHEME);
@@ -2800,7 +2800,7 @@  discard block
 block discarded – undo
2800 2800
 		for ($i = 0, $n = count($smileysfrom); $i < $n; $i++)
2801 2801
 		{
2802 2802
 			$specialChars = $smcFunc['htmlspecialchars']($smileysfrom[$i], ENT_QUOTES);
2803
-			$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">';
2803
+			$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">';
2804 2804
 
2805 2805
 			$smileyPregReplacements[$smileysfrom[$i]] = $smileyCode;
2806 2806
 
@@ -2817,7 +2817,7 @@  discard block
 block discarded – undo
2817 2817
 
2818 2818
 	// Replace away!
2819 2819
 	$message = preg_replace_callback($smileyPregSearch,
2820
-		function ($matches) use ($smileyPregReplacements)
2820
+		function($matches) use ($smileyPregReplacements)
2821 2821
 		{
2822 2822
 			return $smileyPregReplacements[$matches[1]];
2823 2823
 		}, $message);
@@ -2883,13 +2883,13 @@  discard block
 block discarded – undo
2883 2883
 	{
2884 2884
 		if (defined('SID') && SID != '')
2885 2885
 			$setLocation = preg_replace_callback('~^' . preg_quote($scripturl, '/') . '\?(?:' . SID . '(?:;|&|&amp;))((?:board|topic)=[^#]+?)(#[^"]*?)?$~',
2886
-				function ($m) use ($scripturl)
2886
+				function($m) use ($scripturl)
2887 2887
 				{
2888
-					return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html?' . SID. (isset($m[2]) ? "$m[2]" : "");
2888
+					return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html?' . SID . (isset($m[2]) ? "$m[2]" : "");
2889 2889
 				}, $setLocation);
2890 2890
 		else
2891 2891
 			$setLocation = preg_replace_callback('~^' . preg_quote($scripturl, '/') . '\?((?:board|topic)=[^#"]+?)(#[^"]*?)?$~',
2892
-				function ($m) use ($scripturl)
2892
+				function($m) use ($scripturl)
2893 2893
 				{
2894 2894
 					return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html' . (isset($m[2]) ? "$m[2]" : "");
2895 2895
 				}, $setLocation);
@@ -3212,7 +3212,7 @@  discard block
 block discarded – undo
3212 3212
 
3213 3213
 	// Add a generic "Are you sure?" confirmation message.
3214 3214
 	addInlineJavaScript('
3215
-	var smf_you_sure =' . JavaScriptEscape($txt['quickmod_confirm']) .';');
3215
+	var smf_you_sure =' . JavaScriptEscape($txt['quickmod_confirm']) . ';');
3216 3216
 
3217 3217
 	// Now add the capping code for avatars.
3218 3218
 	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')
@@ -3573,7 +3573,7 @@  discard block
 block discarded – undo
3573 3573
 
3574 3574
 		else
3575 3575
 			echo '
3576
-	<script src="', $settings['theme_url'] ,'/scripts/minified', ($do_deferred ? '_deferred' : '') ,'.js', $minSeed ,'"></script>';
3576
+	<script src="', $settings['theme_url'], '/scripts/minified', ($do_deferred ? '_deferred' : ''), '.js', $minSeed, '"></script>';
3577 3577
 	}
3578 3578
 
3579 3579
 	// Inline JavaScript - Actually useful some times!
@@ -3651,14 +3651,14 @@  discard block
 block discarded – undo
3651 3651
 
3652 3652
 		else
3653 3653
 			echo '
3654
-	<link rel="stylesheet" href="', $settings['theme_url'] ,'/css/minified.css', $minSeed ,'">';
3654
+	<link rel="stylesheet" href="', $settings['theme_url'], '/css/minified.css', $minSeed, '">';
3655 3655
 	}
3656 3656
 
3657 3657
 	// Print the rest after the minified files.
3658 3658
 	if (!empty($normal))
3659 3659
 		foreach ($normal as $nf)
3660 3660
 			echo '
3661
-	<link rel="stylesheet" href="', $nf ,'">';
3661
+	<link rel="stylesheet" href="', $nf, '">';
3662 3662
 
3663 3663
 	if ($db_show_debug === true)
3664 3664
 	{
@@ -3674,7 +3674,7 @@  discard block
 block discarded – undo
3674 3674
 	<style>';
3675 3675
 
3676 3676
 		foreach ($context['css_header'] as $css)
3677
-			echo $css .'
3677
+			echo $css . '
3678 3678
 	';
3679 3679
 
3680 3680
 		echo'
@@ -3703,27 +3703,27 @@  discard block
 block discarded – undo
3703 3703
 		return false;
3704 3704
 
3705 3705
 	// Did we already did this?
3706
-	$toCache = cache_get_data('minimized_'. $settings['theme_id'] .'_'. $type, 86400);
3706
+	$toCache = cache_get_data('minimized_' . $settings['theme_id'] . '_' . $type, 86400);
3707 3707
 
3708 3708
 	// Already done?
3709 3709
 	if (!empty($toCache))
3710 3710
 		return true;
3711 3711
 
3712 3712
 	// No namespaces, sorry!
3713
-	$classType = 'MatthiasMullie\\Minify\\'. strtoupper($type);
3713
+	$classType = 'MatthiasMullie\\Minify\\' . strtoupper($type);
3714 3714
 
3715 3715
 	// Temp path.
3716
-	$cTempPath = $settings['theme_dir'] .'/'. ($type == 'css' ? 'css' : 'scripts') .'/';
3716
+	$cTempPath = $settings['theme_dir'] . '/' . ($type == 'css' ? 'css' : 'scripts') . '/';
3717 3717
 
3718 3718
 	// What kind of file are we going to create?
3719
-	$toCreate = $cTempPath .'minified'. ($do_deferred ? '_deferred' : '') .'.'. $type;
3719
+	$toCreate = $cTempPath . 'minified' . ($do_deferred ? '_deferred' : '') . '.' . $type;
3720 3720
 
3721 3721
 	// File has to exists, if it isn't try to create it.
3722 3722
 	if ((!file_exists($toCreate) && @fopen($toCreate, 'w') === false) || !smf_chmod($toCreate))
3723 3723
 	{
3724 3724
 		loadLanguage('Errors');
3725 3725
 		log_error(sprintf($txt['file_not_created'], $toCreate), 'general');
3726
-		cache_put_data('minimized_'. $settings['theme_id'] .'_'. $type, null);
3726
+		cache_put_data('minimized_' . $settings['theme_id'] . '_' . $type, null);
3727 3727
 
3728 3728
 		// The process failed so roll back to print each individual file.
3729 3729
 		return $data;
@@ -3758,14 +3758,14 @@  discard block
 block discarded – undo
3758 3758
 	{
3759 3759
 		loadLanguage('Errors');
3760 3760
 		log_error(sprintf($txt['file_not_created'], $toCreate), 'general');
3761
-		cache_put_data('minimized_'. $settings['theme_id'] .'_'. $type, null);
3761
+		cache_put_data('minimized_' . $settings['theme_id'] . '_' . $type, null);
3762 3762
 
3763 3763
 		// The process failed so roll back to print each individual file.
3764 3764
 		return $data;
3765 3765
 	}
3766 3766
 
3767 3767
 	// And create a long lived cache entry.
3768
-	cache_put_data('minimized_'. $settings['theme_id'] .'_'. $type, $toCreate, 86400);
3768
+	cache_put_data('minimized_' . $settings['theme_id'] . '_' . $type, $toCreate, 86400);
3769 3769
 
3770 3770
 	return true;
3771 3771
 }
@@ -3825,7 +3825,7 @@  discard block
 block discarded – undo
3825 3825
 	else
3826 3826
 		$path = $modSettings['attachmentUploadDir'];
3827 3827
 
3828
-	return $path . '/' . $attachment_id . '_' . $file_hash .'.dat';
3828
+	return $path . '/' . $attachment_id . '_' . $file_hash . '.dat';
3829 3829
 }
3830 3830
 
3831 3831
 /**
@@ -3869,10 +3869,10 @@  discard block
 block discarded – undo
3869 3869
 		$valid_low = isValidIP($ip_parts[0]);
3870 3870
 		$valid_high = isValidIP($ip_parts[1]);
3871 3871
 		$count = 0;
3872
-		$mode = (preg_match('/:/',$ip_parts[0]) > 0 ? ':' : '.');
3872
+		$mode = (preg_match('/:/', $ip_parts[0]) > 0 ? ':' : '.');
3873 3873
 		$max = ($mode == ':' ? 'ffff' : '255');
3874 3874
 		$min = 0;
3875
-		if(!$valid_low)
3875
+		if (!$valid_low)
3876 3876
 		{
3877 3877
 			$ip_parts[0] = preg_replace('/\*/', '0', $ip_parts[0]);
3878 3878
 			$valid_low = isValidIP($ip_parts[0]);
@@ -3886,7 +3886,7 @@  discard block
 block discarded – undo
3886 3886
 		}
3887 3887
 
3888 3888
 		$count = 0;
3889
-		if(!$valid_high)
3889
+		if (!$valid_high)
3890 3890
 		{
3891 3891
 			$ip_parts[1] = preg_replace('/\*/', $max, $ip_parts[1]);
3892 3892
 			$valid_high = isValidIP($ip_parts[1]);
@@ -3899,7 +3899,7 @@  discard block
 block discarded – undo
3899 3899
 			}
3900 3900
 		}
3901 3901
 
3902
-		if($valid_high && $valid_low)
3902
+		if ($valid_high && $valid_low)
3903 3903
 		{
3904 3904
 			$ip_array['low'] = $ip_parts[0];
3905 3905
 			$ip_array['high'] = $ip_parts[1];
@@ -4081,7 +4081,7 @@  discard block
 block discarded – undo
4081 4081
 		addInlineJavaScript('
4082 4082
 	var user_menus = new smc_PopupMenu();
4083 4083
 	user_menus.add("profile", "' . $scripturl . '?action=profile;area=popup");
4084
-	user_menus.add("alerts", "' . $scripturl . '?action=profile;area=alerts_popup;u='. $context['user']['id'] .'");', true);
4084
+	user_menus.add("alerts", "' . $scripturl . '?action=profile;area=alerts_popup;u=' . $context['user']['id'] . '");', true);
4085 4085
 		if ($context['allow_pm'])
4086 4086
 			addInlineJavaScript('
4087 4087
 	user_menus.add("pm", "' . $scripturl . '?action=pm;sa=popup");', true);
@@ -4701,7 +4701,7 @@  discard block
 block discarded – undo
4701 4701
 		// No? try a fallback to $sourcedir
4702 4702
 		else
4703 4703
 		{
4704
-			$absPath = $sourcedir .'/'. $file;
4704
+			$absPath = $sourcedir . '/' . $file;
4705 4705
 
4706 4706
 			if (file_exists($absPath))
4707 4707
 				require_once($absPath);
@@ -4782,15 +4782,15 @@  discard block
 block discarded – undo
4782 4782
 
4783 4783
 	// UTF-8 occurences of MS special characters
4784 4784
 	$findchars_utf8 = array(
4785
-		"\xe2\x80\x9a",	// single low-9 quotation mark
4786
-		"\xe2\x80\x9e",	// double low-9 quotation mark
4787
-		"\xe2\x80\xa6",	// horizontal ellipsis
4788
-		"\xe2\x80\x98",	// left single curly quote
4789
-		"\xe2\x80\x99",	// right single curly quote
4790
-		"\xe2\x80\x9c",	// left double curly quote
4791
-		"\xe2\x80\x9d",	// right double curly quote
4792
-		"\xe2\x80\x93",	// en dash
4793
-		"\xe2\x80\x94",	// em dash
4785
+		"\xe2\x80\x9a", // single low-9 quotation mark
4786
+		"\xe2\x80\x9e", // double low-9 quotation mark
4787
+		"\xe2\x80\xa6", // horizontal ellipsis
4788
+		"\xe2\x80\x98", // left single curly quote
4789
+		"\xe2\x80\x99", // right single curly quote
4790
+		"\xe2\x80\x9c", // left double curly quote
4791
+		"\xe2\x80\x9d", // right double curly quote
4792
+		"\xe2\x80\x93", // en dash
4793
+		"\xe2\x80\x94", // em dash
4794 4794
 	);
4795 4795
 
4796 4796
 	// windows 1252 / iso equivalents
@@ -4808,15 +4808,15 @@  discard block
 block discarded – undo
4808 4808
 
4809 4809
 	// safe replacements
4810 4810
 	$replacechars = array(
4811
-		',',	// &sbquo;
4812
-		',,',	// &bdquo;
4813
-		'...',	// &hellip;
4814
-		"'",	// &lsquo;
4815
-		"'",	// &rsquo;
4816
-		'"',	// &ldquo;
4817
-		'"',	// &rdquo;
4818
-		'-',	// &ndash;
4819
-		'--',	// &mdash;
4811
+		',', // &sbquo;
4812
+		',,', // &bdquo;
4813
+		'...', // &hellip;
4814
+		"'", // &lsquo;
4815
+		"'", // &rsquo;
4816
+		'"', // &ldquo;
4817
+		'"', // &rdquo;
4818
+		'-', // &ndash;
4819
+		'--', // &mdash;
4820 4820
 	);
4821 4821
 
4822 4822
 	if ($context['utf8'])
@@ -5234,7 +5234,7 @@  discard block
 block discarded – undo
5234 5234
  */
5235 5235
 function inet_dtop($bin)
5236 5236
 {
5237
-	if(empty($bin))
5237
+	if (empty($bin))
5238 5238
 		return '';
5239 5239
 
5240 5240
 	global $db_type;
@@ -5265,28 +5265,28 @@  discard block
 block discarded – undo
5265 5265
  */
5266 5266
 function _safe_serialize($value)
5267 5267
 {
5268
-	if(is_null($value))
5268
+	if (is_null($value))
5269 5269
 		return 'N;';
5270 5270
 
5271
-	if(is_bool($value))
5272
-		return 'b:'. (int) $value .';';
5271
+	if (is_bool($value))
5272
+		return 'b:' . (int) $value . ';';
5273 5273
 
5274
-	if(is_int($value))
5275
-		return 'i:'. $value .';';
5274
+	if (is_int($value))
5275
+		return 'i:' . $value . ';';
5276 5276
 
5277
-	if(is_float($value))
5278
-		return 'd:'. str_replace(',', '.', $value) .';';
5277
+	if (is_float($value))
5278
+		return 'd:' . str_replace(',', '.', $value) . ';';
5279 5279
 
5280
-	if(is_string($value))
5281
-		return 's:'. strlen($value) .':"'. $value .'";';
5280
+	if (is_string($value))
5281
+		return 's:' . strlen($value) . ':"' . $value . '";';
5282 5282
 
5283
-	if(is_array($value))
5283
+	if (is_array($value))
5284 5284
 	{
5285 5285
 		$out = '';
5286
-		foreach($value as $k => $v)
5286
+		foreach ($value as $k => $v)
5287 5287
 			$out .= _safe_serialize($k) . _safe_serialize($v);
5288 5288
 
5289
-		return 'a:'. count($value) .':{'. $out .'}';
5289
+		return 'a:' . count($value) . ':{' . $out . '}';
5290 5290
 	}
5291 5291
 
5292 5292
 	// safe_serialize cannot serialize resources or objects.
@@ -5328,7 +5328,7 @@  discard block
 block discarded – undo
5328 5328
 function _safe_unserialize($str)
5329 5329
 {
5330 5330
 	// Input  is not a string.
5331
-	if(empty($str) || !is_string($str))
5331
+	if (empty($str) || !is_string($str))
5332 5332
 		return false;
5333 5333
 
5334 5334
 	$stack = array();
@@ -5342,40 +5342,40 @@  discard block
 block discarded – undo
5342 5342
 	 *   3 - in array, expecting value or another array
5343 5343
 	 */
5344 5344
 	$state = 0;
5345
-	while($state != 1)
5345
+	while ($state != 1)
5346 5346
 	{
5347 5347
 		$type = isset($str[0]) ? $str[0] : '';
5348
-		if($type == '}')
5348
+		if ($type == '}')
5349 5349
 			$str = substr($str, 1);
5350 5350
 
5351
-		else if($type == 'N' && $str[1] == ';')
5351
+		else if ($type == 'N' && $str[1] == ';')
5352 5352
 		{
5353 5353
 			$value = null;
5354 5354
 			$str = substr($str, 2);
5355 5355
 		}
5356
-		else if($type == 'b' && preg_match('/^b:([01]);/', $str, $matches))
5356
+		else if ($type == 'b' && preg_match('/^b:([01]);/', $str, $matches))
5357 5357
 		{
5358 5358
 			$value = $matches[1] == '1' ? true : false;
5359 5359
 			$str = substr($str, 4);
5360 5360
 		}
5361
-		else if($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches))
5361
+		else if ($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches))
5362 5362
 		{
5363
-			$value = (int)$matches[1];
5363
+			$value = (int) $matches[1];
5364 5364
 			$str = $matches[2];
5365 5365
 		}
5366
-		else if($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches))
5366
+		else if ($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches))
5367 5367
 		{
5368
-			$value = (float)$matches[1];
5368
+			$value = (float) $matches[1];
5369 5369
 			$str = $matches[3];
5370 5370
 		}
5371
-		else if($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int)$matches[1], 2) == '";')
5371
+		else if ($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int) $matches[1], 2) == '";')
5372 5372
 		{
5373
-			$value = substr($matches[2], 0, (int)$matches[1]);
5374
-			$str = substr($matches[2], (int)$matches[1] + 2);
5373
+			$value = substr($matches[2], 0, (int) $matches[1]);
5374
+			$str = substr($matches[2], (int) $matches[1] + 2);
5375 5375
 		}
5376
-		else if($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches))
5376
+		else if ($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches))
5377 5377
 		{
5378
-			$expectedLength = (int)$matches[1];
5378
+			$expectedLength = (int) $matches[1];
5379 5379
 			$str = $matches[2];
5380 5380
 		}
5381 5381
 
@@ -5383,10 +5383,10 @@  discard block
 block discarded – undo
5383 5383
 		else
5384 5384
 			return false;
5385 5385
 
5386
-		switch($state)
5386
+		switch ($state)
5387 5387
 		{
5388 5388
 			case 3: // In array, expecting value or another array.
5389
-				if($type == 'a')
5389
+				if ($type == 'a')
5390 5390
 				{
5391 5391
 					$stack[] = &$list;
5392 5392
 					$list[$key] = array();
@@ -5395,7 +5395,7 @@  discard block
 block discarded – undo
5395 5395
 					$state = 2;
5396 5396
 					break;
5397 5397
 				}
5398
-				if($type != '}')
5398
+				if ($type != '}')
5399 5399
 				{
5400 5400
 					$list[$key] = $value;
5401 5401
 					$state = 2;
@@ -5406,29 +5406,29 @@  discard block
 block discarded – undo
5406 5406
 				return false;
5407 5407
 
5408 5408
 			case 2: // in array, expecting end of array or a key
5409
-				if($type == '}')
5409
+				if ($type == '}')
5410 5410
 				{
5411 5411
 					// Array size is less than expected.
5412
-					if(count($list) < end($expected))
5412
+					if (count($list) < end($expected))
5413 5413
 						return false;
5414 5414
 
5415 5415
 					unset($list);
5416
-					$list = &$stack[count($stack)-1];
5416
+					$list = &$stack[count($stack) - 1];
5417 5417
 					array_pop($stack);
5418 5418
 
5419 5419
 					// Go to terminal state if we're at the end of the root array.
5420 5420
 					array_pop($expected);
5421 5421
 
5422
-					if(count($expected) == 0)
5422
+					if (count($expected) == 0)
5423 5423
 						$state = 1;
5424 5424
 
5425 5425
 					break;
5426 5426
 				}
5427 5427
 
5428
-				if($type == 'i' || $type == 's')
5428
+				if ($type == 'i' || $type == 's')
5429 5429
 				{
5430 5430
 					// Array size exceeds expected length.
5431
-					if(count($list) >= end($expected))
5431
+					if (count($list) >= end($expected))
5432 5432
 						return false;
5433 5433
 
5434 5434
 					$key = $value;
@@ -5441,7 +5441,7 @@  discard block
 block discarded – undo
5441 5441
 
5442 5442
 			// Expecting array or value.
5443 5443
 			case 0:
5444
-				if($type == 'a')
5444
+				if ($type == 'a')
5445 5445
 				{
5446 5446
 					$data = array();
5447 5447
 					$list = &$data;
@@ -5450,7 +5450,7 @@  discard block
 block discarded – undo
5450 5450
 					break;
5451 5451
 				}
5452 5452
 
5453
-				if($type != '}')
5453
+				if ($type != '}')
5454 5454
 				{
5455 5455
 					$data = $value;
5456 5456
 					$state = 1;
@@ -5463,7 +5463,7 @@  discard block
 block discarded – undo
5463 5463
 	}
5464 5464
 
5465 5465
 	// Trailing data in input.
5466
-	if(!empty($str))
5466
+	if (!empty($str))
5467 5467
 		return false;
5468 5468
 
5469 5469
 	return $data;
@@ -5517,7 +5517,7 @@  discard block
 block discarded – undo
5517 5517
 	// Set different modes.
5518 5518
 	$chmodValues = $isDir ? array(0750, 0755, 0775, 0777) : array(0644, 0664, 0666);
5519 5519
 
5520
-	foreach($chmodValues as $val)
5520
+	foreach ($chmodValues as $val)
5521 5521
 	{
5522 5522
 		// If it's writable, break out of the loop.
5523 5523
 		if (is_writable($file))
@@ -5552,13 +5552,13 @@  discard block
 block discarded – undo
5552 5552
 	$returnArray = @json_decode($json, $returnAsArray);
5553 5553
 
5554 5554
 	// PHP 5.3 so no json_last_error_msg()
5555
-	switch(json_last_error())
5555
+	switch (json_last_error())
5556 5556
 	{
5557 5557
 		case JSON_ERROR_NONE:
5558 5558
 			$jsonError = false;
5559 5559
 			break;
5560 5560
 		case JSON_ERROR_DEPTH:
5561
-			$jsonError =  'JSON_ERROR_DEPTH';
5561
+			$jsonError = 'JSON_ERROR_DEPTH';
5562 5562
 			break;
5563 5563
 		case JSON_ERROR_STATE_MISMATCH:
5564 5564
 			$jsonError = 'JSON_ERROR_STATE_MISMATCH';
@@ -5586,10 +5586,10 @@  discard block
 block discarded – undo
5586 5586
 		loadLanguage('Errors');
5587 5587
 
5588 5588
 		if (!empty($jsonDebug))
5589
-			log_error($txt['json_'. $jsonError], 'critical', $jsonDebug['file'], $jsonDebug['line']);
5589
+			log_error($txt['json_' . $jsonError], 'critical', $jsonDebug['file'], $jsonDebug['line']);
5590 5590
 
5591 5591
 		else
5592
-			log_error($txt['json_'. $jsonError], 'critical');
5592
+			log_error($txt['json_' . $jsonError], 'critical');
5593 5593
 
5594 5594
 		// Everyone expects an array.
5595 5595
 		return array();
@@ -5701,7 +5701,7 @@  discard block
 block discarded – undo
5701 5701
 		});
5702 5702
 
5703 5703
 		// Convert Punycode to Unicode
5704
-		$tlds = array_map(function ($input) {
5704
+		$tlds = array_map(function($input) {
5705 5705
 			$prefix = 'xn--';
5706 5706
 			$safe_char = 0xFFFC;
5707 5707
 			$base = 36;
@@ -5717,7 +5717,7 @@  discard block
 block discarded – undo
5717 5717
 
5718 5718
 			foreach ($enco_parts as $encoded)
5719 5719
 			{
5720
-				if (strpos($encoded,$prefix) !== 0 || strlen(trim(str_replace($prefix,'',$encoded))) == 0)
5720
+				if (strpos($encoded, $prefix) !== 0 || strlen(trim(str_replace($prefix, '', $encoded))) == 0)
5721 5721
 				{
5722 5722
 					$output_parts[] = $encoded;
5723 5723
 					continue;
@@ -5728,7 +5728,7 @@  discard block
 block discarded – undo
5728 5728
 				$idx = 0;
5729 5729
 				$char = 0x80;
5730 5730
 				$decoded = array();
5731
-				$output='';
5731
+				$output = '';
5732 5732
 				$delim_pos = strrpos($encoded, '-');
5733 5733
 
5734 5734
 				if ($delim_pos > strlen($prefix))
@@ -5744,7 +5744,7 @@  discard block
 block discarded – undo
5744 5744
 
5745 5745
 				for ($enco_idx = $delim_pos ? ($delim_pos + 1) : 0; $enco_idx < $enco_len; ++$deco_len)
5746 5746
 				{
5747
-					for ($old_idx = $idx, $w = 1, $k = $base; 1 ; $k += $base)
5747
+					for ($old_idx = $idx, $w = 1, $k = $base; 1; $k += $base)
5748 5748
 					{
5749 5749
 						$cp = ord($encoded{$enco_idx++});
5750 5750
 						$digit = ($cp - 48 < 10) ? $cp - 22 : (($cp - 65 < 26) ? $cp - 65 : (($cp - 97 < 26) ? $cp - 97 : $base));
@@ -5785,15 +5785,15 @@  discard block
 block discarded – undo
5785 5785
 
5786 5786
 					// 2 bytes
5787 5787
 					elseif ($v < (1 << 11))
5788
-						$output .= chr(192+($v >> 6)) . chr(128+($v & 63));
5788
+						$output .= chr(192 + ($v >> 6)) . chr(128 + ($v & 63));
5789 5789
 
5790 5790
 					// 3 bytes
5791 5791
 					elseif ($v < (1 << 16))
5792
-						$output .= chr(224+($v >> 12)) . chr(128+(($v >> 6) & 63)) . chr(128+($v & 63));
5792
+						$output .= chr(224 + ($v >> 12)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63));
5793 5793
 
5794 5794
 					// 4 bytes
5795 5795
 					elseif ($v < (1 << 21))
5796
-						$output .= chr(240+($v >> 18)) . chr(128+(($v >> 12) & 63)) . chr(128+(($v >> 6) & 63)) . chr(128+($v & 63));
5796
+						$output .= chr(240 + ($v >> 18)) . chr(128 + (($v >> 12) & 63)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63));
5797 5797
 
5798 5798
 					//  'Conversion from UCS-4 to UTF-8 failed: malformed input at byte '.$k
5799 5799
 					else
@@ -5898,7 +5898,7 @@  discard block
 block discarded – undo
5898 5898
 	}
5899 5899
 
5900 5900
 	// This recursive function creates the index array from the strings
5901
-	$add_string_to_index = function ($string, $index) use (&$strlen, &$substr, &$add_string_to_index)
5901
+	$add_string_to_index = function($string, $index) use (&$strlen, &$substr, &$add_string_to_index)
5902 5902
 	{
5903 5903
 		static $depth = 0;
5904 5904
 		$depth++;
@@ -5925,7 +5925,7 @@  discard block
 block discarded – undo
5925 5925
 	};
5926 5926
 
5927 5927
 	// This recursive function turns the index array into a regular expression
5928
-	$index_to_regex = function (&$index, $delim) use (&$strlen, &$index_to_regex)
5928
+	$index_to_regex = function(&$index, $delim) use (&$strlen, &$index_to_regex)
5929 5929
 	{
5930 5930
 		static $depth = 0;
5931 5931
 		$depth++;
@@ -5949,11 +5949,11 @@  discard block
 block discarded – undo
5949 5949
 
5950 5950
 				if (count(array_keys($value)) == 1)
5951 5951
 				{
5952
-					$new_key_array = explode('(?'.'>', $sub_regex);
5952
+					$new_key_array = explode('(?' . '>', $sub_regex);
5953 5953
 					$new_key .= $new_key_array[0];
5954 5954
 				}
5955 5955
 				else
5956
-					$sub_regex = '(?'.'>' . $sub_regex . ')';
5956
+					$sub_regex = '(?' . '>' . $sub_regex . ')';
5957 5957
 			}
5958 5958
 
5959 5959
 			if ($depth > 1)
@@ -5996,10 +5996,10 @@  discard block
 block discarded – undo
5996 5996
 	{
5997 5997
 		$regex = array();
5998 5998
 		while (!empty($index))
5999
-			$regex[] = '(?'.'>' . $index_to_regex($index, $delim) . ')';
5999
+			$regex[] = '(?' . '>' . $index_to_regex($index, $delim) . ')';
6000 6000
 	}
6001 6001
 	else
6002
-		$regex = '(?'.'>' . $index_to_regex($index, $delim) . ')';
6002
+		$regex = '(?' . '>' . $index_to_regex($index, $delim) . ')';
6003 6003
 
6004 6004
 	// Restore PHP's internal character encoding to whatever it was originally
6005 6005
 	if (!empty($current_encoding))
Please login to merge, or discard this patch.