Completed
Push — release-2.1 ( 1330d8...6018b1 )
by Colin
09:13
created
Themes/default/index.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -229,7 +229,7 @@
 block discarded – undo
229 229
 			//In maintenance mode, only login is allowed and don't show OverlayDiv
230 230
 			echo '
231 231
 			<ul class="floatleft welcome">
232
-				<li>', sprintf($txt['welcome_guest'], $txt['guest_title'], '', $scripturl. '?action=login', 'return true;'), '</li>
232
+				<li>', sprintf($txt['welcome_guest'], $txt['guest_title'], '', $scripturl . '?action=login', 'return true;'), '</li>
233 233
 			</ul>';
234 234
 
235 235
 	if (!empty($modSettings['userLanguage']) && !empty($context['languages']) && count($context['languages']) > 1)
Please login to merge, or discard this patch.
Sources/ManageAttachments.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1542,7 +1542,7 @@  discard block
 block discarded – undo
1542 1542
 					'no_msg' => 0,
1543 1543
 					'substep' => $_GET['substep'],
1544 1544
 					'ignore_ids' => $ignore_ids,
1545
-					'attach_thumb' => array(0,3),
1545
+					'attach_thumb' => array(0, 3),
1546 1546
 				)
1547 1547
 			);
1548 1548
 			
@@ -1572,7 +1572,7 @@  discard block
 block discarded – undo
1572 1572
 					array(
1573 1573
 						'to_remove' => $to_remove,
1574 1574
 						'no_member' => 0,
1575
-						'attach_thumb' => array(0,3),
1575
+						'attach_thumb' => array(0, 3),
1576 1576
 					)
1577 1577
 				);
1578 1578
 
Please login to merge, or discard this patch.
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
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['myid_first_msg'] == $row['myid_first_msg'] && $row['myid_first_msg'] == $row['myid_first_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.
Sources/minify/src/Minify.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
     {
326 326
         // PHP only supports $this inside anonymous functions since 5.4
327 327
         $minifier = $this;
328
-        $callback = function ($match) use ($minifier) {
328
+        $callback = function($match) use ($minifier) {
329 329
             // check the second index here, because the first always contains a quote
330 330
             if ($match[2] === '') {
331 331
                 /*
@@ -338,8 +338,8 @@  discard block
 block discarded – undo
338 338
             }
339 339
 
340 340
             $count = count($minifier->extracted);
341
-            $placeholder = $match[1].$count.$match[1];
342
-            $minifier->extracted[$placeholder] = $match[1].$match[2].$match[1];
341
+            $placeholder = $match[1] . $count . $match[1];
342
+            $minifier->extracted[$placeholder] = $match[1] . $match[2] . $match[1];
343 343
 
344 344
             return $placeholder;
345 345
         };
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
          * considered as escape-char (times 2) and to get it in the regex,
357 357
          * escaped (times 2)
358 358
          */
359
-        $this->registerPattern('/(['.$chars.'])(.*?(?<!\\\\)(\\\\\\\\)*+)\\1/s', $callback);
359
+        $this->registerPattern('/([' . $chars . '])(.*?(?<!\\\\)(\\\\\\\\)*+)\\1/s', $callback);
360 360
     }
361 361
 
362 362
     /**
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
     protected function openFileForWriting($path)
407 407
     {
408 408
         if (($handler = @fopen($path, 'w')) === false) {
409
-            throw new IOException('The file "'.$path.'" could not be opened for writing. Check if PHP has enough permissions.');
409
+            throw new IOException('The file "' . $path . '" could not be opened for writing. Check if PHP has enough permissions.');
410 410
         }
411 411
 
412 412
         return $handler;
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
     protected function writeToFile($handler, $content, $path = '')
425 425
     {
426 426
         if (($result = @fwrite($handler, $content)) === false || ($result < strlen($content))) {
427
-            throw new IOException('The file "'.$path.'" could not be written to. Check your disk space and file permissions.');
427
+            throw new IOException('The file "' . $path . '" could not be written to. Check your disk space and file permissions.');
428 428
         }
429 429
     }
430 430
 }
Please login to merge, or discard this patch.
Sources/SearchAPI-Fulltext.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 
207 207
 		if (!empty($modSettings['search_simple_fulltext']))
208 208
 		{
209
-			if($smcFunc['db_title'] == "PostgreSQL")
209
+			if ($smcFunc['db_title'] == "PostgreSQL")
210 210
 			{
211 211
 				$language_ftx = $smcFunc['db_search_language']();
212 212
 				
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 			// remove any indexed words that are used in the complex body search terms
225 225
 			$words['indexed_words'] = array_diff($words['indexed_words'], $words['complex_words']);
226 226
 
227
-			if($smcFunc['db_title'] == "PostgreSQL"){
227
+			if ($smcFunc['db_title'] == "PostgreSQL") {
228 228
 				$row = 0;
229 229
 				foreach ($words['indexed_words'] as $fulltextWord) {
230 230
 					$query_params['boolean_match'] .= ($row <> 0 ? '&' : '');
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 
241 241
 			// if we have bool terms to search, add them in
242 242
 			if ($query_params['boolean_match']) {
243
-				if($smcFunc['db_title'] == "PostgreSQL")
243
+				if ($smcFunc['db_title'] == "PostgreSQL")
244 244
 				{
245 245
 					$language_ftx = $smcFunc['db_search_language']();
246 246
 					
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 
254 254
 		}
255 255
 
256
-		$ignoreRequest = $smcFunc['db_search_query']('insert_into_log_messages_fulltext', ($smcFunc['db_support_ignore'] ? ( '
256
+		$ignoreRequest = $smcFunc['db_search_query']('insert_into_log_messages_fulltext', ($smcFunc['db_support_ignore'] ? ('
257 257
 			INSERT IGNORE INTO {db_prefix}' . $search_data['insert_into'] . '
258 258
 				(' . implode(', ', array_keys($query_select)) . ')') : '') . '
259 259
 			SELECT ' . implode(', ', $query_select) . '
Please login to merge, or discard this patch.
Sources/Post.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -256,8 +256,8 @@  discard block
 block discarded – undo
256 256
 			$time_string = str_replace(array('%I', '%H', '%S', '%r', '%R', '%T'), array('%l', '%k', '', '%l:%M %p', '%k:%M', '%l:%M'), $matches[0]);
257 257
 
258 258
 		$js_time_string = str_replace(
259
-			array('%H', '%k', '%I', '%l', '%M', '%p', '%P', '%r',      '%R',  '%S', '%T',    '%X'),
260
-			array('H',  'G',  'h',  'g',  'i',  'A',  'a',  'h:i:s A', 'H:i', 's',  'H:i:s', 'H:i:s'),
259
+			array('%H', '%k', '%I', '%l', '%M', '%p', '%P', '%r', '%R', '%S', '%T', '%X'),
260
+			array('H', 'G', 'h', 'g', 'i', 'A', 'a', 'h:i:s A', 'H:i', 's', 'H:i:s', 'H:i:s'),
261 261
 			$time_string
262 262
 		);
263 263
 
@@ -1306,14 +1306,14 @@  discard block
 block discarded – undo
1306 1306
 	if (isset($context['name']) && isset($context['email']))
1307 1307
 	{
1308 1308
 		$context['posting_fields']['guestname'] = array(
1309
-			'dt' => '<span id="caption_guestname"' .  (isset($context['post_error']['long_name']) || isset($context['post_error']['no_name']) || isset($context['post_error']['bad_name']) ? ' class="error"' : '') . '>' . $txt['name'] . '</span>',
1309
+			'dt' => '<span id="caption_guestname"' . (isset($context['post_error']['long_name']) || isset($context['post_error']['no_name']) || isset($context['post_error']['bad_name']) ? ' class="error"' : '') . '>' . $txt['name'] . '</span>',
1310 1310
 			'dd' => '<input type="text" name="guestname" size="25" value="' . $context['name'] . '" class="input_text" required>',
1311 1311
 		);
1312 1312
 
1313 1313
 		if (empty($modSettings['guest_post_no_email']))
1314 1314
 		{
1315 1315
 			$context['posting_fields']['email'] = array(
1316
-				'dt' => '<span id="caption_email"' .  (isset($context['post_error']['no_email']) || isset($context['post_error']['bad_email']) ? ' class="error"' : '') . '>' . $txt['email'] . '</span>',
1316
+				'dt' => '<span id="caption_email"' . (isset($context['post_error']['no_email']) || isset($context['post_error']['bad_email']) ? ' class="error"' : '') . '>' . $txt['email'] . '</span>',
1317 1317
 				'dd' => '<input type="email" name="email" size="25" value="' . $context['email'] . '" class="input_text" required>',
1318 1318
 			);
1319 1319
 		}
Please login to merge, or discard this patch.
Themes/default/Display.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -670,7 +670,7 @@
 block discarded – undo
670 670
 	// Show "<< Last Edit: Time by Person >>" if this post was edited. But we need the div even if it wasn't modified!
671 671
 	// Because we insert into it through AJAX and we don't want to stop themers moving it around if they so wish so they can put it where they want it.
672 672
 	echo '
673
-									<span class="smalltext modified floatright', !empty($modSettings['show_modify']) && !empty($message['modified']['name']) ? ' mvisible' : '','" id="modified_', $message['id'], '">';
673
+									<span class="smalltext modified floatright', !empty($modSettings['show_modify']) && !empty($message['modified']['name']) ? ' mvisible' : '', '" id="modified_', $message['id'], '">';
674 674
 
675 675
 	if (!empty($modSettings['show_modify']) && !empty($message['modified']['name']))
676 676
 		echo
Please login to merge, or discard this patch.
Sources/News.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 		$smcFunc['db_free_result']($request);
166 166
 
167 167
 		$feed_meta['title'] = ' - ' . strip_tags($board_info['name']);
168
-		$feed_meta['source'] .= '?board=' . $board . '.0' ;
168
+		$feed_meta['source'] .= '?board=' . $board . '.0';
169 169
 
170 170
 		$query_this_board = 'b.id_board = ' . $board;
171 171
 
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 
390 390
 		foreach ($xml_data as $item)
391 391
 		{
392
-			$link = array_filter($item['content'], function ($e) { return ($e['tag'] == 'link'); });
392
+			$link = array_filter($item['content'], function($e) { return ($e['tag'] == 'link'); });
393 393
 			$link = array_pop($link);
394 394
 
395 395
 			echo '
Please login to merge, or discard this patch.
Sources/Subs.php 1 patch
Spacing   +117 added lines, -117 removed lines patch added patch discarded remove patch
@@ -1097,7 +1097,7 @@  discard block
 block discarded – undo
1097 1097
 					'height' => array('optional' => true, 'match' => '(\d+)'),
1098 1098
 				),
1099 1099
 				'content' => '$1',
1100
-				'validate' => function (&$tag, &$data, $disabled, $params) use ($modSettings, $context, $sourcedir, $txt)
1100
+				'validate' => function(&$tag, &$data, $disabled, $params) use ($modSettings, $context, $sourcedir, $txt)
1101 1101
 				{
1102 1102
 					$returnContext = '';
1103 1103
 
@@ -1132,7 +1132,7 @@  discard block
 block discarded – undo
1132 1132
 						}
1133 1133
 
1134 1134
 						if ($currentAttachment['thumbnail']['has_thumb'] && empty($params['{width}']) && empty($params['{height}']))
1135
-							$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>';
1135
+							$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>';
1136 1136
 						else
1137 1137
 							$returnContext .= '<img src="' . $currentAttachment['href'] . ';image"' . $alt . $title . $width . $height . ' class="bbc_img"/>';
1138 1138
 					}
@@ -1161,7 +1161,7 @@  discard block
 block discarded – undo
1161 1161
 				'type' => 'unparsed_content',
1162 1162
 				'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>',
1163 1163
 				// @todo Maybe this can be simplified?
1164
-				'validate' => isset($disabled['code']) ? null : function (&$tag, &$data, $disabled) use ($context)
1164
+				'validate' => isset($disabled['code']) ? null : function(&$tag, &$data, $disabled) use ($context)
1165 1165
 				{
1166 1166
 					if (!isset($disabled['code']))
1167 1167
 					{
@@ -1198,7 +1198,7 @@  discard block
 block discarded – undo
1198 1198
 				'type' => 'unparsed_equals_content',
1199 1199
 				'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>',
1200 1200
 				// @todo Maybe this can be simplified?
1201
-				'validate' => isset($disabled['code']) ? null : function (&$tag, &$data, $disabled) use ($context)
1201
+				'validate' => isset($disabled['code']) ? null : function(&$tag, &$data, $disabled) use ($context)
1202 1202
 				{
1203 1203
 					if (!isset($disabled['code']))
1204 1204
 					{
@@ -1242,7 +1242,7 @@  discard block
 block discarded – undo
1242 1242
 				'type' => 'unparsed_content',
1243 1243
 				'content' => '<a href="mailto:$1" class="bbc_email">$1</a>',
1244 1244
 				// @todo Should this respect guest_hideContacts?
1245
-				'validate' => function (&$tag, &$data, $disabled)
1245
+				'validate' => function(&$tag, &$data, $disabled)
1246 1246
 				{
1247 1247
 					$data = strtr($data, array('<br>' => ''));
1248 1248
 				},
@@ -1261,7 +1261,7 @@  discard block
 block discarded – undo
1261 1261
 				'type' => 'unparsed_commas_content',
1262 1262
 				'test' => '\d+,\d+\]',
1263 1263
 				'content' => '<embed type="application/x-shockwave-flash" src="$1" width="$2" height="$3" play="true" loop="true" quality="high" AllowScriptAccess="never">',
1264
-				'validate' => function (&$tag, &$data, $disabled)
1264
+				'validate' => function(&$tag, &$data, $disabled)
1265 1265
 				{
1266 1266
 					if (isset($disabled['url']))
1267 1267
 						$tag['content'] = '$1';
@@ -1277,7 +1277,7 @@  discard block
 block discarded – undo
1277 1277
 				'test' => '(left|right)(\s+max=\d+(?:%|px|em|rem|ex|pt|pc|ch|vw|vh|vmin|vmax|cm|mm|in)?)?\]',
1278 1278
 				'before' => '<div $1>',
1279 1279
 				'after' => '</div>',
1280
-				'validate' => function (&$tag, &$data, $disabled)
1280
+				'validate' => function(&$tag, &$data, $disabled)
1281 1281
 				{
1282 1282
 					$class = 'class="bbc_float float' . (strpos($data, 'left') === 0 ? 'left' : 'right') . '"';
1283 1283
 
@@ -1326,7 +1326,7 @@  discard block
 block discarded – undo
1326 1326
 					'height' => array('optional' => true, 'value' => ' height="$1"', 'match' => '(\d+)'),
1327 1327
 				),
1328 1328
 				'content' => '<img src="$1" alt="{alt}" title="{title}"{width}{height} class="bbc_img resized">',
1329
-				'validate' => function (&$tag, &$data, $disabled)
1329
+				'validate' => function(&$tag, &$data, $disabled)
1330 1330
 				{
1331 1331
 					global $image_proxy_enabled, $image_proxy_secret, $boardurl;
1332 1332
 
@@ -1349,7 +1349,7 @@  discard block
 block discarded – undo
1349 1349
 				'tag' => 'img',
1350 1350
 				'type' => 'unparsed_content',
1351 1351
 				'content' => '<img src="$1" alt="" class="bbc_img">',
1352
-				'validate' => function (&$tag, &$data, $disabled)
1352
+				'validate' => function(&$tag, &$data, $disabled)
1353 1353
 				{
1354 1354
 					global $image_proxy_enabled, $image_proxy_secret, $boardurl;
1355 1355
 
@@ -1372,7 +1372,7 @@  discard block
 block discarded – undo
1372 1372
 				'tag' => 'iurl',
1373 1373
 				'type' => 'unparsed_content',
1374 1374
 				'content' => '<a href="$1" class="bbc_link">$1</a>',
1375
-				'validate' => function (&$tag, &$data, $disabled)
1375
+				'validate' => function(&$tag, &$data, $disabled)
1376 1376
 				{
1377 1377
 					$data = strtr($data, array('<br>' => ''));
1378 1378
 					$scheme = parse_url($data, PHP_URL_SCHEME);
@@ -1386,7 +1386,7 @@  discard block
 block discarded – undo
1386 1386
 				'quoted' => 'optional',
1387 1387
 				'before' => '<a href="$1" class="bbc_link">',
1388 1388
 				'after' => '</a>',
1389
-				'validate' => function (&$tag, &$data, $disabled)
1389
+				'validate' => function(&$tag, &$data, $disabled)
1390 1390
 				{
1391 1391
 					if (substr($data, 0, 1) == '#')
1392 1392
 						$data = '#post_' . substr($data, 1);
@@ -1466,7 +1466,7 @@  discard block
 block discarded – undo
1466 1466
 				'tag' => 'php',
1467 1467
 				'type' => 'unparsed_content',
1468 1468
 				'content' => '<span class="phpcode">$1</span>',
1469
-				'validate' => isset($disabled['php']) ? null : function (&$tag, &$data, $disabled)
1469
+				'validate' => isset($disabled['php']) ? null : function(&$tag, &$data, $disabled)
1470 1470
 				{
1471 1471
 					if (!isset($disabled['php']))
1472 1472
 					{
@@ -1564,7 +1564,7 @@  discard block
 block discarded – undo
1564 1564
 				'test' => '[1-7]\]',
1565 1565
 				'before' => '<span style="font-size: $1;" class="bbc_size">',
1566 1566
 				'after' => '</span>',
1567
-				'validate' => function (&$tag, &$data, $disabled)
1567
+				'validate' => function(&$tag, &$data, $disabled)
1568 1568
 				{
1569 1569
 					$sizes = array(1 => 0.7, 2 => 1.0, 3 => 1.35, 4 => 1.45, 5 => 2.0, 6 => 2.65, 7 => 3.95);
1570 1570
 					$data = $sizes[$data] . 'em';
@@ -1602,7 +1602,7 @@  discard block
 block discarded – undo
1602 1602
 				'tag' => 'time',
1603 1603
 				'type' => 'unparsed_content',
1604 1604
 				'content' => '$1',
1605
-				'validate' => function (&$tag, &$data, $disabled)
1605
+				'validate' => function(&$tag, &$data, $disabled)
1606 1606
 				{
1607 1607
 					if (is_numeric($data))
1608 1608
 						$data = timeformat($data);
@@ -1630,7 +1630,7 @@  discard block
 block discarded – undo
1630 1630
 				'tag' => 'url',
1631 1631
 				'type' => 'unparsed_content',
1632 1632
 				'content' => '<a href="$1" class="bbc_link" target="_blank">$1</a>',
1633
-				'validate' => function (&$tag, &$data, $disabled)
1633
+				'validate' => function(&$tag, &$data, $disabled)
1634 1634
 				{
1635 1635
 					$data = strtr($data, array('<br>' => ''));
1636 1636
 					$scheme = parse_url($data, PHP_URL_SCHEME);
@@ -1644,7 +1644,7 @@  discard block
 block discarded – undo
1644 1644
 				'quoted' => 'optional',
1645 1645
 				'before' => '<a href="$1" class="bbc_link" target="_blank">',
1646 1646
 				'after' => '</a>',
1647
-				'validate' => function (&$tag, &$data, $disabled)
1647
+				'validate' => function(&$tag, &$data, $disabled)
1648 1648
 				{
1649 1649
 					$scheme = parse_url($data, PHP_URL_SCHEME);
1650 1650
 					if (empty($scheme))
@@ -1670,7 +1670,7 @@  discard block
 block discarded – undo
1670 1670
 		{
1671 1671
 			if (isset($temp_bbc))
1672 1672
 				$bbc_codes = $temp_bbc;
1673
-			usort($codes, function ($a, $b) {
1673
+			usort($codes, function($a, $b) {
1674 1674
 				return strcmp($a['tag'], $b['tag']);
1675 1675
 			});
1676 1676
 			return $codes;
@@ -1908,7 +1908,7 @@  discard block
 block discarded – undo
1908 1908
 										# a run of Unicode domain name characters and a dot
1909 1909
 										[\p{L}\p{M}\p{N}\-.:@]+\.
1910 1910
 										# and then a TLD valid in the DNS or the reserved "local" TLD
1911
-										(?:'. $modSettings['tld_regex'] .'|local)
1911
+										(?:'. $modSettings['tld_regex'] . '|local)
1912 1912
 									)
1913 1913
 									# followed by a non-domain character or end of line
1914 1914
 									(?=[^\p{L}\p{N}\-.]|$)
@@ -1976,7 +1976,7 @@  discard block
 block discarded – undo
1976 1976
 						)?
1977 1977
 						';
1978 1978
 
1979
-						$data = preg_replace_callback('~' . $url_regex . '~xi' . ($context['utf8'] ? 'u' : ''), function ($matches) {
1979
+						$data = preg_replace_callback('~' . $url_regex . '~xi' . ($context['utf8'] ? 'u' : ''), function($matches) {
1980 1980
 							$url = array_shift($matches);
1981 1981
 
1982 1982
 							$scheme = parse_url($url, PHP_URL_SCHEME);
@@ -2713,7 +2713,7 @@  discard block
 block discarded – undo
2713 2713
 		for ($i = 0, $n = count($smileysfrom); $i < $n; $i++)
2714 2714
 		{
2715 2715
 			$specialChars = $smcFunc['htmlspecialchars']($smileysfrom[$i], ENT_QUOTES);
2716
-			$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">';
2716
+			$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">';
2717 2717
 
2718 2718
 			$smileyPregReplacements[$smileysfrom[$i]] = $smileyCode;
2719 2719
 
@@ -2730,7 +2730,7 @@  discard block
 block discarded – undo
2730 2730
 
2731 2731
 	// Replace away!
2732 2732
 	$message = preg_replace_callback($smileyPregSearch,
2733
-		function ($matches) use ($smileyPregReplacements)
2733
+		function($matches) use ($smileyPregReplacements)
2734 2734
 		{
2735 2735
 			return $smileyPregReplacements[$matches[1]];
2736 2736
 		}, $message);
@@ -2796,13 +2796,13 @@  discard block
 block discarded – undo
2796 2796
 	{
2797 2797
 		if (defined('SID') && SID != '')
2798 2798
 			$setLocation = preg_replace_callback('~^' . preg_quote($scripturl, '/') . '\?(?:' . SID . '(?:;|&|&amp;))((?:board|topic)=[^#]+?)(#[^"]*?)?$~',
2799
-				function ($m) use ($scripturl)
2799
+				function($m) use ($scripturl)
2800 2800
 				{
2801
-					return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html?' . SID. (isset($m[2]) ? "$m[2]" : "");
2801
+					return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html?' . SID . (isset($m[2]) ? "$m[2]" : "");
2802 2802
 				}, $setLocation);
2803 2803
 		else
2804 2804
 			$setLocation = preg_replace_callback('~^' . preg_quote($scripturl, '/') . '\?((?:board|topic)=[^#"]+?)(#[^"]*?)?$~',
2805
-				function ($m) use ($scripturl)
2805
+				function($m) use ($scripturl)
2806 2806
 				{
2807 2807
 					return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html' . (isset($m[2]) ? "$m[2]" : "");
2808 2808
 				}, $setLocation);
@@ -3125,7 +3125,7 @@  discard block
 block discarded – undo
3125 3125
 
3126 3126
 	// Add a generic "Are you sure?" confirmation message.
3127 3127
 	addInlineJavaScript('
3128
-	var smf_you_sure =' . JavaScriptEscape($txt['quickmod_confirm']) .';');
3128
+	var smf_you_sure =' . JavaScriptEscape($txt['quickmod_confirm']) . ';');
3129 3129
 
3130 3130
 	// Now add the capping code for avatars.
3131 3131
 	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')
@@ -3486,7 +3486,7 @@  discard block
 block discarded – undo
3486 3486
 
3487 3487
 		else
3488 3488
 			echo '
3489
-	<script src="', $settings['theme_url'] ,'/scripts/minified', ($do_deferred ? '_deferred' : '') ,'.js', $minSeed ,'"></script>';
3489
+	<script src="', $settings['theme_url'], '/scripts/minified', ($do_deferred ? '_deferred' : ''), '.js', $minSeed, '"></script>';
3490 3490
 	}
3491 3491
 
3492 3492
 	// Inline JavaScript - Actually useful some times!
@@ -3564,14 +3564,14 @@  discard block
 block discarded – undo
3564 3564
 
3565 3565
 		else
3566 3566
 			echo '
3567
-	<link rel="stylesheet" href="', $settings['theme_url'] ,'/css/minified.css', $minSeed ,'">';
3567
+	<link rel="stylesheet" href="', $settings['theme_url'], '/css/minified.css', $minSeed, '">';
3568 3568
 	}
3569 3569
 
3570 3570
 	// Print the rest after the minified files.
3571 3571
 	if (!empty($normal))
3572 3572
 		foreach ($normal as $nf)
3573 3573
 			echo '
3574
-	<link rel="stylesheet" href="', $nf ,'">';
3574
+	<link rel="stylesheet" href="', $nf, '">';
3575 3575
 
3576 3576
 	if ($db_show_debug === true)
3577 3577
 	{
@@ -3587,7 +3587,7 @@  discard block
 block discarded – undo
3587 3587
 	<style>';
3588 3588
 
3589 3589
 		foreach ($context['css_header'] as $css)
3590
-			echo $css .'
3590
+			echo $css . '
3591 3591
 	';
3592 3592
 
3593 3593
 		echo'
@@ -3616,27 +3616,27 @@  discard block
 block discarded – undo
3616 3616
 		return false;
3617 3617
 
3618 3618
 	// Did we already did this?
3619
-	$toCache = cache_get_data('minimized_'. $settings['theme_id'] .'_'. $type, 86400);
3619
+	$toCache = cache_get_data('minimized_' . $settings['theme_id'] . '_' . $type, 86400);
3620 3620
 
3621 3621
 	// Already done?
3622 3622
 	if (!empty($toCache))
3623 3623
 		return true;
3624 3624
 
3625 3625
 	// No namespaces, sorry!
3626
-	$classType = 'MatthiasMullie\\Minify\\'. strtoupper($type);
3626
+	$classType = 'MatthiasMullie\\Minify\\' . strtoupper($type);
3627 3627
 
3628 3628
 	// Temp path.
3629
-	$cTempPath = $settings['theme_dir'] .'/'. ($type == 'css' ? 'css' : 'scripts') .'/';
3629
+	$cTempPath = $settings['theme_dir'] . '/' . ($type == 'css' ? 'css' : 'scripts') . '/';
3630 3630
 
3631 3631
 	// What kind of file are we going to create?
3632
-	$toCreate = $cTempPath .'minified'. ($do_deferred ? '_deferred' : '') .'.'. $type;
3632
+	$toCreate = $cTempPath . 'minified' . ($do_deferred ? '_deferred' : '') . '.' . $type;
3633 3633
 
3634 3634
 	// File has to exists, if it isn't try to create it.
3635 3635
 	if ((!file_exists($toCreate) && @fopen($toCreate, 'w') === false) || !smf_chmod($toCreate))
3636 3636
 	{
3637 3637
 		loadLanguage('Errors');
3638 3638
 		log_error(sprintf($txt['file_not_created'], $toCreate), 'general');
3639
-		cache_put_data('minimized_'. $settings['theme_id'] .'_'. $type, null);
3639
+		cache_put_data('minimized_' . $settings['theme_id'] . '_' . $type, null);
3640 3640
 
3641 3641
 		// The process failed so roll back to print each individual file.
3642 3642
 		return $data;
@@ -3671,14 +3671,14 @@  discard block
 block discarded – undo
3671 3671
 	{
3672 3672
 		loadLanguage('Errors');
3673 3673
 		log_error(sprintf($txt['file_not_created'], $toCreate), 'general');
3674
-		cache_put_data('minimized_'. $settings['theme_id'] .'_'. $type, null);
3674
+		cache_put_data('minimized_' . $settings['theme_id'] . '_' . $type, null);
3675 3675
 
3676 3676
 		// The process failed so roll back to print each individual file.
3677 3677
 		return $data;
3678 3678
 	}
3679 3679
 
3680 3680
 	// And create a long lived cache entry.
3681
-	cache_put_data('minimized_'. $settings['theme_id'] .'_'. $type, $toCreate, 86400);
3681
+	cache_put_data('minimized_' . $settings['theme_id'] . '_' . $type, $toCreate, 86400);
3682 3682
 
3683 3683
 	return true;
3684 3684
 }
@@ -3738,7 +3738,7 @@  discard block
 block discarded – undo
3738 3738
 	else
3739 3739
 		$path = $modSettings['attachmentUploadDir'];
3740 3740
 
3741
-	return $path . '/' . $attachment_id . '_' . $file_hash .'.dat';
3741
+	return $path . '/' . $attachment_id . '_' . $file_hash . '.dat';
3742 3742
 }
3743 3743
 
3744 3744
 /**
@@ -3782,10 +3782,10 @@  discard block
 block discarded – undo
3782 3782
 		$valid_low = isValidIP($ip_parts[0]);
3783 3783
 		$valid_high = isValidIP($ip_parts[1]);
3784 3784
 		$count = 0;
3785
-		$mode = (preg_match('/:/',$ip_parts[0]) > 0 ? ':' : '.');
3785
+		$mode = (preg_match('/:/', $ip_parts[0]) > 0 ? ':' : '.');
3786 3786
 		$max = ($mode == ':' ? 'ffff' : '255');
3787 3787
 		$min = 0;
3788
-		if(!$valid_low)
3788
+		if (!$valid_low)
3789 3789
 		{
3790 3790
 			$ip_parts[0] = preg_replace('/\*/', '0', $ip_parts[0]);
3791 3791
 			$valid_low = isValidIP($ip_parts[0]);
@@ -3799,7 +3799,7 @@  discard block
 block discarded – undo
3799 3799
 		}
3800 3800
 
3801 3801
 		$count = 0;
3802
-		if(!$valid_high)
3802
+		if (!$valid_high)
3803 3803
 		{
3804 3804
 			$ip_parts[1] = preg_replace('/\*/', $max, $ip_parts[1]);
3805 3805
 			$valid_high = isValidIP($ip_parts[1]);
@@ -3812,7 +3812,7 @@  discard block
 block discarded – undo
3812 3812
 			}
3813 3813
 		}
3814 3814
 
3815
-		if($valid_high && $valid_low)
3815
+		if ($valid_high && $valid_low)
3816 3816
 		{
3817 3817
 			$ip_array['low'] = $ip_parts[0];
3818 3818
 			$ip_array['high'] = $ip_parts[1];
@@ -3994,7 +3994,7 @@  discard block
 block discarded – undo
3994 3994
 		addInlineJavaScript('
3995 3995
 	var user_menus = new smc_PopupMenu();
3996 3996
 	user_menus.add("profile", "' . $scripturl . '?action=profile;area=popup");
3997
-	user_menus.add("alerts", "' . $scripturl . '?action=profile;area=alerts_popup;u='. $context['user']['id'] .'");', true);
3997
+	user_menus.add("alerts", "' . $scripturl . '?action=profile;area=alerts_popup;u=' . $context['user']['id'] . '");', true);
3998 3998
 		if ($context['allow_pm'])
3999 3999
 			addInlineJavaScript('
4000 4000
 	user_menus.add("pm", "' . $scripturl . '?action=pm;sa=popup");', true);
@@ -4619,7 +4619,7 @@  discard block
 block discarded – undo
4619 4619
 		// No? try a fallback to $sourcedir
4620 4620
 		else
4621 4621
 		{
4622
-			$absPath = $sourcedir .'/'. $file;
4622
+			$absPath = $sourcedir . '/' . $file;
4623 4623
 
4624 4624
 			if (file_exists($absPath))
4625 4625
 				require_once($absPath);
@@ -4700,15 +4700,15 @@  discard block
 block discarded – undo
4700 4700
 
4701 4701
 	// UTF-8 occurences of MS special characters
4702 4702
 	$findchars_utf8 = array(
4703
-		"\xe2\x80\x9a",	// single low-9 quotation mark
4704
-		"\xe2\x80\x9e",	// double low-9 quotation mark
4705
-		"\xe2\x80\xa6",	// horizontal ellipsis
4706
-		"\xe2\x80\x98",	// left single curly quote
4707
-		"\xe2\x80\x99",	// right single curly quote
4708
-		"\xe2\x80\x9c",	// left double curly quote
4709
-		"\xe2\x80\x9d",	// right double curly quote
4710
-		"\xe2\x80\x93",	// en dash
4711
-		"\xe2\x80\x94",	// em dash
4703
+		"\xe2\x80\x9a", // single low-9 quotation mark
4704
+		"\xe2\x80\x9e", // double low-9 quotation mark
4705
+		"\xe2\x80\xa6", // horizontal ellipsis
4706
+		"\xe2\x80\x98", // left single curly quote
4707
+		"\xe2\x80\x99", // right single curly quote
4708
+		"\xe2\x80\x9c", // left double curly quote
4709
+		"\xe2\x80\x9d", // right double curly quote
4710
+		"\xe2\x80\x93", // en dash
4711
+		"\xe2\x80\x94", // em dash
4712 4712
 	);
4713 4713
 
4714 4714
 	// windows 1252 / iso equivalents
@@ -4726,15 +4726,15 @@  discard block
 block discarded – undo
4726 4726
 
4727 4727
 	// safe replacements
4728 4728
 	$replacechars = array(
4729
-		',',	// &sbquo;
4730
-		',,',	// &bdquo;
4731
-		'...',	// &hellip;
4732
-		"'",	// &lsquo;
4733
-		"'",	// &rsquo;
4734
-		'"',	// &ldquo;
4735
-		'"',	// &rdquo;
4736
-		'-',	// &ndash;
4737
-		'--',	// &mdash;
4729
+		',', // &sbquo;
4730
+		',,', // &bdquo;
4731
+		'...', // &hellip;
4732
+		"'", // &lsquo;
4733
+		"'", // &rsquo;
4734
+		'"', // &ldquo;
4735
+		'"', // &rdquo;
4736
+		'-', // &ndash;
4737
+		'--', // &mdash;
4738 4738
 	);
4739 4739
 
4740 4740
 	if ($context['utf8'])
@@ -5097,7 +5097,7 @@  discard block
 block discarded – undo
5097 5097
  */
5098 5098
 function inet_dtop($bin)
5099 5099
 {
5100
-	if(empty($bin))
5100
+	if (empty($bin))
5101 5101
 		return '';
5102 5102
 
5103 5103
 	global $db_type;
@@ -5128,28 +5128,28 @@  discard block
 block discarded – undo
5128 5128
  */
5129 5129
 function _safe_serialize($value)
5130 5130
 {
5131
-	if(is_null($value))
5131
+	if (is_null($value))
5132 5132
 		return 'N;';
5133 5133
 
5134
-	if(is_bool($value))
5135
-		return 'b:'. (int) $value .';';
5134
+	if (is_bool($value))
5135
+		return 'b:' . (int) $value . ';';
5136 5136
 
5137
-	if(is_int($value))
5138
-		return 'i:'. $value .';';
5137
+	if (is_int($value))
5138
+		return 'i:' . $value . ';';
5139 5139
 
5140
-	if(is_float($value))
5141
-		return 'd:'. str_replace(',', '.', $value) .';';
5140
+	if (is_float($value))
5141
+		return 'd:' . str_replace(',', '.', $value) . ';';
5142 5142
 
5143
-	if(is_string($value))
5144
-		return 's:'. strlen($value) .':"'. $value .'";';
5143
+	if (is_string($value))
5144
+		return 's:' . strlen($value) . ':"' . $value . '";';
5145 5145
 
5146
-	if(is_array($value))
5146
+	if (is_array($value))
5147 5147
 	{
5148 5148
 		$out = '';
5149
-		foreach($value as $k => $v)
5149
+		foreach ($value as $k => $v)
5150 5150
 			$out .= _safe_serialize($k) . _safe_serialize($v);
5151 5151
 
5152
-		return 'a:'. count($value) .':{'. $out .'}';
5152
+		return 'a:' . count($value) . ':{' . $out . '}';
5153 5153
 	}
5154 5154
 
5155 5155
 	// safe_serialize cannot serialize resources or objects.
@@ -5191,7 +5191,7 @@  discard block
 block discarded – undo
5191 5191
 function _safe_unserialize($str)
5192 5192
 {
5193 5193
 	// Input  is not a string.
5194
-	if(empty($str) || !is_string($str))
5194
+	if (empty($str) || !is_string($str))
5195 5195
 		return false;
5196 5196
 
5197 5197
 	$stack = array();
@@ -5205,40 +5205,40 @@  discard block
 block discarded – undo
5205 5205
 	 *   3 - in array, expecting value or another array
5206 5206
 	 */
5207 5207
 	$state = 0;
5208
-	while($state != 1)
5208
+	while ($state != 1)
5209 5209
 	{
5210 5210
 		$type = isset($str[0]) ? $str[0] : '';
5211
-		if($type == '}')
5211
+		if ($type == '}')
5212 5212
 			$str = substr($str, 1);
5213 5213
 
5214
-		else if($type == 'N' && $str[1] == ';')
5214
+		else if ($type == 'N' && $str[1] == ';')
5215 5215
 		{
5216 5216
 			$value = null;
5217 5217
 			$str = substr($str, 2);
5218 5218
 		}
5219
-		else if($type == 'b' && preg_match('/^b:([01]);/', $str, $matches))
5219
+		else if ($type == 'b' && preg_match('/^b:([01]);/', $str, $matches))
5220 5220
 		{
5221 5221
 			$value = $matches[1] == '1' ? true : false;
5222 5222
 			$str = substr($str, 4);
5223 5223
 		}
5224
-		else if($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches))
5224
+		else if ($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches))
5225 5225
 		{
5226
-			$value = (int)$matches[1];
5226
+			$value = (int) $matches[1];
5227 5227
 			$str = $matches[2];
5228 5228
 		}
5229
-		else if($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches))
5229
+		else if ($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches))
5230 5230
 		{
5231
-			$value = (float)$matches[1];
5231
+			$value = (float) $matches[1];
5232 5232
 			$str = $matches[3];
5233 5233
 		}
5234
-		else if($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int)$matches[1], 2) == '";')
5234
+		else if ($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int) $matches[1], 2) == '";')
5235 5235
 		{
5236
-			$value = substr($matches[2], 0, (int)$matches[1]);
5237
-			$str = substr($matches[2], (int)$matches[1] + 2);
5236
+			$value = substr($matches[2], 0, (int) $matches[1]);
5237
+			$str = substr($matches[2], (int) $matches[1] + 2);
5238 5238
 		}
5239
-		else if($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches))
5239
+		else if ($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches))
5240 5240
 		{
5241
-			$expectedLength = (int)$matches[1];
5241
+			$expectedLength = (int) $matches[1];
5242 5242
 			$str = $matches[2];
5243 5243
 		}
5244 5244
 
@@ -5246,10 +5246,10 @@  discard block
 block discarded – undo
5246 5246
 		else
5247 5247
 			return false;
5248 5248
 
5249
-		switch($state)
5249
+		switch ($state)
5250 5250
 		{
5251 5251
 			case 3: // In array, expecting value or another array.
5252
-				if($type == 'a')
5252
+				if ($type == 'a')
5253 5253
 				{
5254 5254
 					$stack[] = &$list;
5255 5255
 					$list[$key] = array();
@@ -5258,7 +5258,7 @@  discard block
 block discarded – undo
5258 5258
 					$state = 2;
5259 5259
 					break;
5260 5260
 				}
5261
-				if($type != '}')
5261
+				if ($type != '}')
5262 5262
 				{
5263 5263
 					$list[$key] = $value;
5264 5264
 					$state = 2;
@@ -5269,29 +5269,29 @@  discard block
 block discarded – undo
5269 5269
 				return false;
5270 5270
 
5271 5271
 			case 2: // in array, expecting end of array or a key
5272
-				if($type == '}')
5272
+				if ($type == '}')
5273 5273
 				{
5274 5274
 					// Array size is less than expected.
5275
-					if(count($list) < end($expected))
5275
+					if (count($list) < end($expected))
5276 5276
 						return false;
5277 5277
 
5278 5278
 					unset($list);
5279
-					$list = &$stack[count($stack)-1];
5279
+					$list = &$stack[count($stack) - 1];
5280 5280
 					array_pop($stack);
5281 5281
 
5282 5282
 					// Go to terminal state if we're at the end of the root array.
5283 5283
 					array_pop($expected);
5284 5284
 
5285
-					if(count($expected) == 0)
5285
+					if (count($expected) == 0)
5286 5286
 						$state = 1;
5287 5287
 
5288 5288
 					break;
5289 5289
 				}
5290 5290
 
5291
-				if($type == 'i' || $type == 's')
5291
+				if ($type == 'i' || $type == 's')
5292 5292
 				{
5293 5293
 					// Array size exceeds expected length.
5294
-					if(count($list) >= end($expected))
5294
+					if (count($list) >= end($expected))
5295 5295
 						return false;
5296 5296
 
5297 5297
 					$key = $value;
@@ -5304,7 +5304,7 @@  discard block
 block discarded – undo
5304 5304
 
5305 5305
 			// Expecting array or value.
5306 5306
 			case 0:
5307
-				if($type == 'a')
5307
+				if ($type == 'a')
5308 5308
 				{
5309 5309
 					$data = array();
5310 5310
 					$list = &$data;
@@ -5313,7 +5313,7 @@  discard block
 block discarded – undo
5313 5313
 					break;
5314 5314
 				}
5315 5315
 
5316
-				if($type != '}')
5316
+				if ($type != '}')
5317 5317
 				{
5318 5318
 					$data = $value;
5319 5319
 					$state = 1;
@@ -5326,7 +5326,7 @@  discard block
 block discarded – undo
5326 5326
 	}
5327 5327
 
5328 5328
 	// Trailing data in input.
5329
-	if(!empty($str))
5329
+	if (!empty($str))
5330 5330
 		return false;
5331 5331
 
5332 5332
 	return $data;
@@ -5380,7 +5380,7 @@  discard block
 block discarded – undo
5380 5380
 	// Set different modes.
5381 5381
 	$chmodValues = $isDir ? array(0750, 0755, 0775, 0777) : array(0644, 0664, 0666);
5382 5382
 
5383
-	foreach($chmodValues as $val)
5383
+	foreach ($chmodValues as $val)
5384 5384
 	{
5385 5385
 		// If it's writable, break out of the loop.
5386 5386
 		if (is_writable($file))
@@ -5415,13 +5415,13 @@  discard block
 block discarded – undo
5415 5415
 	$returnArray = @json_decode($json, $returnAsArray);
5416 5416
 
5417 5417
 	// PHP 5.3 so no json_last_error_msg()
5418
-	switch(json_last_error())
5418
+	switch (json_last_error())
5419 5419
 	{
5420 5420
 		case JSON_ERROR_NONE:
5421 5421
 			$jsonError = false;
5422 5422
 			break;
5423 5423
 		case JSON_ERROR_DEPTH:
5424
-			$jsonError =  'JSON_ERROR_DEPTH';
5424
+			$jsonError = 'JSON_ERROR_DEPTH';
5425 5425
 			break;
5426 5426
 		case JSON_ERROR_STATE_MISMATCH:
5427 5427
 			$jsonError = 'JSON_ERROR_STATE_MISMATCH';
@@ -5449,10 +5449,10 @@  discard block
 block discarded – undo
5449 5449
 		loadLanguage('Errors');
5450 5450
 
5451 5451
 		if (!empty($jsonDebug))
5452
-			log_error($txt['json_'. $jsonError], 'critical', $jsonDebug['file'], $jsonDebug['line']);
5452
+			log_error($txt['json_' . $jsonError], 'critical', $jsonDebug['file'], $jsonDebug['line']);
5453 5453
 
5454 5454
 		else
5455
-			log_error($txt['json_'. $jsonError], 'critical');
5455
+			log_error($txt['json_' . $jsonError], 'critical');
5456 5456
 
5457 5457
 		// Everyone expects an array.
5458 5458
 		return array();
@@ -5556,7 +5556,7 @@  discard block
 block discarded – undo
5556 5556
 		});
5557 5557
 
5558 5558
 		// Convert Punycode to Unicode
5559
-		$tlds = array_map(function ($input) {
5559
+		$tlds = array_map(function($input) {
5560 5560
 			$prefix = 'xn--';
5561 5561
 			$safe_char = 0xFFFC;
5562 5562
 			$base = 36;
@@ -5572,7 +5572,7 @@  discard block
 block discarded – undo
5572 5572
 
5573 5573
 			foreach ($enco_parts as $encoded)
5574 5574
 			{
5575
-				if (strpos($encoded,$prefix) !== 0 || strlen(trim(str_replace($prefix,'',$encoded))) == 0)
5575
+				if (strpos($encoded, $prefix) !== 0 || strlen(trim(str_replace($prefix, '', $encoded))) == 0)
5576 5576
 				{
5577 5577
 					$output_parts[] = $encoded;
5578 5578
 					continue;
@@ -5583,7 +5583,7 @@  discard block
 block discarded – undo
5583 5583
 				$idx = 0;
5584 5584
 				$char = 0x80;
5585 5585
 				$decoded = array();
5586
-				$output='';
5586
+				$output = '';
5587 5587
 				$delim_pos = strrpos($encoded, '-');
5588 5588
 
5589 5589
 				if ($delim_pos > strlen($prefix))
@@ -5599,7 +5599,7 @@  discard block
 block discarded – undo
5599 5599
 
5600 5600
 				for ($enco_idx = $delim_pos ? ($delim_pos + 1) : 0; $enco_idx < $enco_len; ++$deco_len)
5601 5601
 				{
5602
-					for ($old_idx = $idx, $w = 1, $k = $base; 1 ; $k += $base)
5602
+					for ($old_idx = $idx, $w = 1, $k = $base; 1; $k += $base)
5603 5603
 					{
5604 5604
 						$cp = ord($encoded{$enco_idx++});
5605 5605
 						$digit = ($cp - 48 < 10) ? $cp - 22 : (($cp - 65 < 26) ? $cp - 65 : (($cp - 97 < 26) ? $cp - 97 : $base));
@@ -5640,15 +5640,15 @@  discard block
 block discarded – undo
5640 5640
 
5641 5641
 					// 2 bytes
5642 5642
 					elseif ($v < (1 << 11))
5643
-						$output .= chr(192+($v >> 6)) . chr(128+($v & 63));
5643
+						$output .= chr(192 + ($v >> 6)) . chr(128 + ($v & 63));
5644 5644
 
5645 5645
 					// 3 bytes
5646 5646
 					elseif ($v < (1 << 16))
5647
-						$output .= chr(224+($v >> 12)) . chr(128+(($v >> 6) & 63)) . chr(128+($v & 63));
5647
+						$output .= chr(224 + ($v >> 12)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63));
5648 5648
 
5649 5649
 					// 4 bytes
5650 5650
 					elseif ($v < (1 << 21))
5651
-						$output .= chr(240+($v >> 18)) . chr(128+(($v >> 12) & 63)) . chr(128+(($v >> 6) & 63)) . chr(128+($v & 63));
5651
+						$output .= chr(240 + ($v >> 18)) . chr(128 + (($v >> 12) & 63)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63));
5652 5652
 
5653 5653
 					//  'Conversion from UCS-4 to UTF-8 failed: malformed input at byte '.$k
5654 5654
 					else
@@ -5755,7 +5755,7 @@  discard block
 block discarded – undo
5755 5755
 	}
5756 5756
 
5757 5757
 	// This recursive function creates the index array from the strings
5758
-	$add_string_to_index = function ($string, $index) use (&$strlen, &$substr, &$add_string_to_index)
5758
+	$add_string_to_index = function($string, $index) use (&$strlen, &$substr, &$add_string_to_index)
5759 5759
 	{
5760 5760
 		static $depth = 0;
5761 5761
 		$depth++;
@@ -5782,7 +5782,7 @@  discard block
 block discarded – undo
5782 5782
 	};
5783 5783
 
5784 5784
 	// This recursive function turns the index array into a regular expression
5785
-	$index_to_regex = function (&$index, $delim) use (&$strlen, &$index_to_regex)
5785
+	$index_to_regex = function(&$index, $delim) use (&$strlen, &$index_to_regex)
5786 5786
 	{
5787 5787
 		static $depth = 0;
5788 5788
 		$depth++;
@@ -5806,11 +5806,11 @@  discard block
 block discarded – undo
5806 5806
 
5807 5807
 				if (count(array_keys($value)) == 1)
5808 5808
 				{
5809
-					$new_key_array = explode('(?'.'>', $sub_regex);
5809
+					$new_key_array = explode('(?' . '>', $sub_regex);
5810 5810
 					$new_key .= $new_key_array[0];
5811 5811
 				}
5812 5812
 				else
5813
-					$sub_regex = '(?'.'>' . $sub_regex . ')';
5813
+					$sub_regex = '(?' . '>' . $sub_regex . ')';
5814 5814
 			}
5815 5815
 
5816 5816
 			if ($depth > 1)
@@ -5850,7 +5850,7 @@  discard block
 block discarded – undo
5850 5850
 		$index = $add_string_to_index($string, $index);
5851 5851
 
5852 5852
 	while (!empty($index))
5853
-		$regexes[] = '(?'.'>' . $index_to_regex($index, $delim) . ')';
5853
+		$regexes[] = '(?' . '>' . $index_to_regex($index, $delim) . ')';
5854 5854
 
5855 5855
 	// Restore PHP's internal character encoding to whatever it was originally
5856 5856
 	if (!empty($current_encoding))
Please login to merge, or discard this patch.