Completed
Push — release-2.1 ( d322d4...5b3f1b )
by Colin
08:15
created
Sources/SearchAPI-Fulltext.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 		$query_where = array();
167 167
 		$query_params = $search_data['params'];
168 168
 
169
-		if( $smcFunc['db_title'] == "PostgreSQL")
169
+		if ($smcFunc['db_title'] == "PostgreSQL")
170 170
 			$modSettings['search_simple_fulltext'] = true;
171 171
 
172 172
 		if ($query_params['id_search'])
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 			// if we have bool terms to search, add them in
247 247
 			if ($query_params['boolean_match'])
248 248
 			{
249
-				if($smcFunc['db_title'] == "PostgreSQL")
249
+				if ($smcFunc['db_title'] == "PostgreSQL")
250 250
 				{
251 251
 					$language_ftx = $smcFunc['db_search_language']();
252 252
 
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 			}
259 259
 		}
260 260
 
261
-		$ignoreRequest = $smcFunc['db_search_query']('insert_into_log_messages_fulltext', ($smcFunc['db_support_ignore'] ? ( '
261
+		$ignoreRequest = $smcFunc['db_search_query']('insert_into_log_messages_fulltext', ($smcFunc['db_support_ignore'] ? ('
262 262
 			INSERT IGNORE INTO {db_prefix}' . $search_data['insert_into'] . '
263 263
 				(' . implode(', ', array_keys($query_select)) . ')') : '') . '
264 264
 			SELECT ' . implode(', ', $query_select) . '
Please login to merge, or discard this patch.
Sources/RepairBoards.php 1 patch
Spacing   +35 added lines, -35 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
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 				  AND p.id_poll IS NULL
356 356
 				GROUP BY o.id_poll, t.id_topic, t.id_board, t.id_member_started, m.member_name
357 357
 				  ',
358
-			'fix_processing' => function ($row) use ($smcFunc, $txt)
358
+			'fix_processing' => function($row) use ($smcFunc, $txt)
359 359
 			{
360 360
 				global $salvageBoardID;
361 361
 
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
 				{
367 367
 					// Only if we don't have a reasonable idea of where to put it.
368 368
 					createSalvageArea();
369
-					$row['id_board'] = (int)$salvageBoardID;
369
+					$row['id_board'] = (int) $salvageBoardID;
370 370
 				}
371 371
 
372 372
 				if (empty($row['id_topic']))
@@ -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
 
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
 				WHERE t.id_topic BETWEEN {STEP_LOW} AND {STEP_HIGH}
604 604
 				GROUP BY t.id_topic, t.id_first_msg, t.id_last_msg, t.approved, mf.approved
605 605
 				ORDER BY t.id_topic',
606
-			'fix_processing' => function ($row) use ($smcFunc)
606
+			'fix_processing' => function($row) use ($smcFunc)
607 607
 			{
608 608
 				$row['firstmsg_approved'] = (int) $row['firstmsg_approved'];
609 609
 				$row['myid_first_msg'] = (int) $row['myid_first_msg'];
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
 					)
633 633
 				);
634 634
 			},
635
-			'message_function' => function ($row) use ($txt, &$context)
635
+			'message_function' => function($row) use ($txt, &$context)
636 636
 			{
637 637
 				// A pretend error?
638 638
 				if ($row['id_first_msg'] == $row['myid_first_msg'] && $row['id_last_msg'] == $row['myid_last_msg'] && $row['approved'] == $row['firstmsg_approved'])
@@ -666,7 +666,7 @@  discard block
 block discarded – undo
666 666
 				WHERE t.id_topic BETWEEN {STEP_LOW} AND {STEP_HIGH}
667 667
 				GROUP BY t.id_topic, t.num_replies, mf.approved
668 668
 				ORDER BY t.id_topic',
669
-			'fix_processing' => function ($row)
669
+			'fix_processing' => function($row)
670 670
 			{
671 671
 				global $smcFunc;
672 672
 				$row['my_num_replies'] = (int) $row['my_num_replies'];
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
 					)
686 686
 				);
687 687
 			},
688
-			'message_function' => function ($row)
688
+			'message_function' => function($row)
689 689
 			{
690 690
 				global $txt, $context;
691 691
 
@@ -716,7 +716,7 @@  discard block
 block discarded – undo
716 716
 				GROUP BY t.id_topic, t.unapproved_posts
717 717
 				HAVING unapproved_posts != COUNT(mu.id_msg)
718 718
 				ORDER BY t.id_topic',
719
-			'fix_processing' => function ($row)
719
+			'fix_processing' => function($row)
720 720
 			{
721 721
 				global $smcFunc;
722 722
 				$row['my_unapproved_posts'] = (int) $row['my_unapproved_posts'];
@@ -756,7 +756,7 @@  discard block
 block discarded – undo
756 756
 				WHERE b.id_board IS NULL
757 757
 					AND t.id_topic BETWEEN {STEP_LOW} AND {STEP_HIGH}
758 758
 				GROUP BY t.id_board',
759
-			'fix_processing' => function ($row)
759
+			'fix_processing' => function($row)
760 760
 			{
761 761
 				global $smcFunc, $salvageCatID, $txt;
762 762
 				createSalvageArea();
@@ -803,7 +803,7 @@  discard block
 block discarded – undo
803 803
 				ORDER BY b.id_cat, b.id_board',
804 804
 			'fix_collect' => array(
805 805
 				'index' => 'id_cat',
806
-				'process' => function ($cats)
806
+				'process' => function($cats)
807 807
 				{
808 808
 					global $smcFunc, $salvageCatID;
809 809
 					createSalvageArea();
@@ -839,7 +839,7 @@  discard block
 block discarded – undo
839 839
 			// Last step-make sure all non-guest posters still exist.
840 840
 			'fix_collect' => array(
841 841
 				'index' => 'id_msg',
842
-				'process' => function ($msgs)
842
+				'process' => function($msgs)
843 843
 				{
844 844
 					global $smcFunc;
845 845
 					$smcFunc['db_query']('', '
@@ -866,7 +866,7 @@  discard block
 block discarded – undo
866 866
 				ORDER BY b.id_parent, b.id_board',
867 867
 			'fix_collect' => array(
868 868
 				'index' => 'id_parent',
869
-				'process' => function ($parents)
869
+				'process' => function($parents)
870 870
 				{
871 871
 					global $smcFunc, $salvageBoardID, $salvageCatID;
872 872
 					createSalvageArea();
@@ -900,7 +900,7 @@  discard block
 block discarded – undo
900 900
 					AND p.id_poll IS NULL',
901 901
 			'fix_collect' => array(
902 902
 				'index' => 'id_poll',
903
-				'process' => function ($polls)
903
+				'process' => function($polls)
904 904
 				{
905 905
 					global $smcFunc;
906 906
 					$smcFunc['db_query']('', '
@@ -932,7 +932,7 @@  discard block
 block discarded – undo
932 932
 				ORDER BY cal.id_topic',
933 933
 			'fix_collect' => array(
934 934
 				'index' => 'id_topic',
935
-				'process' => function ($events)
935
+				'process' => function($events)
936 936
 				{
937 937
 					global $smcFunc;
938 938
 					$smcFunc['db_query']('', '
@@ -962,7 +962,7 @@  discard block
 block discarded – undo
962 962
 					AND lt.id_member BETWEEN {STEP_LOW} AND {STEP_HIGH}',
963 963
 			'fix_collect' => array(
964 964
 				'index' => 'id_topic',
965
-				'process' => function ($topics)
965
+				'process' => function($topics)
966 966
 				{
967 967
 					global $smcFunc;
968 968
 					$smcFunc['db_query']('', '
@@ -992,7 +992,7 @@  discard block
 block discarded – undo
992 992
 				GROUP BY lt.id_member',
993 993
 			'fix_collect' => array(
994 994
 				'index' => 'id_member',
995
-				'process' => function ($members)
995
+				'process' => function($members)
996 996
 				{
997 997
 					global $smcFunc;
998 998
 					$smcFunc['db_query']('', '
@@ -1022,7 +1022,7 @@  discard block
 block discarded – undo
1022 1022
 				GROUP BY lb.id_board',
1023 1023
 			'fix_collect' => array(
1024 1024
 				'index' => 'id_board',
1025
-				'process' => function ($boards)
1025
+				'process' => function($boards)
1026 1026
 				{
1027 1027
 					global $smcFunc;
1028 1028
 					$smcFunc['db_query']('', '
@@ -1052,7 +1052,7 @@  discard block
 block discarded – undo
1052 1052
 				GROUP BY lb.id_member',
1053 1053
 			'fix_collect' => array(
1054 1054
 				'index' => 'id_member',
1055
-				'process' => function ($members) use ($smcFunc)
1055
+				'process' => function($members) use ($smcFunc)
1056 1056
 				{
1057 1057
 					$smcFunc['db_query']('', '
1058 1058
 						DELETE FROM {db_prefix}log_boards
@@ -1081,7 +1081,7 @@  discard block
 block discarded – undo
1081 1081
 				GROUP BY lmr.id_board',
1082 1082
 			'fix_collect' => array(
1083 1083
 				'index' => 'id_board',
1084
-				'process' => function ($boards) use ($smcFunc)
1084
+				'process' => function($boards) use ($smcFunc)
1085 1085
 				{
1086 1086
 					$smcFunc['db_query']('', '
1087 1087
 						DELETE FROM {db_prefix}log_mark_read
@@ -1110,7 +1110,7 @@  discard block
 block discarded – undo
1110 1110
 				GROUP BY lmr.id_member',
1111 1111
 			'fix_collect' => array(
1112 1112
 				'index' => 'id_member',
1113
-				'process' => function ($members) use ($smcFunc)
1113
+				'process' => function($members) use ($smcFunc)
1114 1114
 				{
1115 1115
 					$smcFunc['db_query']('', '
1116 1116
 						DELETE FROM {db_prefix}log_mark_read
@@ -1139,7 +1139,7 @@  discard block
 block discarded – undo
1139 1139
 				GROUP BY pmr.id_pm',
1140 1140
 			'fix_collect' => array(
1141 1141
 				'index' => 'id_pm',
1142
-				'process' => function ($pms) use ($smcFunc)
1142
+				'process' => function($pms) use ($smcFunc)
1143 1143
 				{
1144 1144
 					$smcFunc['db_query']('', '
1145 1145
 						DELETE FROM {db_prefix}pm_recipients
@@ -1169,7 +1169,7 @@  discard block
 block discarded – undo
1169 1169
 				GROUP BY pmr.id_member',
1170 1170
 			'fix_collect' => array(
1171 1171
 				'index' => 'id_member',
1172
-				'process' => function ($members)
1172
+				'process' => function($members)
1173 1173
 				{
1174 1174
 					global $smcFunc;
1175 1175
 					$smcFunc['db_query']('', '
@@ -1199,7 +1199,7 @@  discard block
 block discarded – undo
1199 1199
 					AND mem.id_member IS NULL',
1200 1200
 			'fix_collect' => array(
1201 1201
 				'index' => 'id_pm',
1202
-				'process' => function ($guestMessages)
1202
+				'process' => function($guestMessages)
1203 1203
 				{
1204 1204
 					global $smcFunc;
1205 1205
 					$smcFunc['db_query']('', '
@@ -1229,7 +1229,7 @@  discard block
 block discarded – undo
1229 1229
 				GROUP BY ln.id_member',
1230 1230
 			'fix_collect' => array(
1231 1231
 				'index' => 'id_member',
1232
-				'process' => function ($members) use ($smcFunc)
1232
+				'process' => function($members) use ($smcFunc)
1233 1233
 				{
1234 1234
 					$smcFunc['db_query']('', '
1235 1235
 						DELETE FROM {db_prefix}log_notify
@@ -1256,7 +1256,7 @@  discard block
 block discarded – undo
1256 1256
 					LEFT JOIN {db_prefix}log_search_subjects AS lss ON (lss.id_topic = t.id_topic)
1257 1257
 				WHERE t.id_topic BETWEEN {STEP_LOW} AND {STEP_HIGH}
1258 1258
 					AND lss.id_topic IS NULL',
1259
-			'fix_full_processing' => function ($result)
1259
+			'fix_full_processing' => function($result)
1260 1260
 			{
1261 1261
 				global $smcFunc;
1262 1262
 
@@ -1285,7 +1285,7 @@  discard block
 block discarded – undo
1285 1285
 						array('word', 'id_topic')
1286 1286
 					);
1287 1287
 			},
1288
-			'message_function' => function ($row)
1288
+			'message_function' => function($row)
1289 1289
 			{
1290 1290
 				global $txt, $context;
1291 1291
 
@@ -1313,7 +1313,7 @@  discard block
 block discarded – undo
1313 1313
 					AND t.id_topic IS NULL',
1314 1314
 			'fix_collect' => array(
1315 1315
 				'index' => 'id_topic',
1316
-				'process' => function ($deleteTopics)
1316
+				'process' => function($deleteTopics)
1317 1317
 				{
1318 1318
 					global $smcFunc;
1319 1319
 					$smcFunc['db_query']('', '
@@ -1343,7 +1343,7 @@  discard block
 block discarded – undo
1343 1343
 					AND mem.id_member IS NULL',
1344 1344
 			'fix_collect' => array(
1345 1345
 				'index' => 'id_member',
1346
-				'process' => function ($members)
1346
+				'process' => function($members)
1347 1347
 				{
1348 1348
 					global $smcFunc;
1349 1349
 					$smcFunc['db_query']('', '
@@ -1372,7 +1372,7 @@  discard block
 block discarded – undo
1372 1372
 					AND p.id_poll IS NULL',
1373 1373
 			'fix_collect' => array(
1374 1374
 				'index' => 'id_poll',
1375
-				'process' => function ($polls)
1375
+				'process' => function($polls)
1376 1376
 				{
1377 1377
 					global $smcFunc;
1378 1378
 					$smcFunc['db_query']('', '
@@ -1401,7 +1401,7 @@  discard block
 block discarded – undo
1401 1401
 					AND lrc.id_report IS NULL',
1402 1402
 			'fix_collect' => array(
1403 1403
 				'index' => 'id_report',
1404
-				'process' => function ($reports)
1404
+				'process' => function($reports)
1405 1405
 				{
1406 1406
 					global $smcFunc;
1407 1407
 					$smcFunc['db_query']('', '
@@ -1430,7 +1430,7 @@  discard block
 block discarded – undo
1430 1430
 					AND lr.id_report IS NULL',
1431 1431
 			'fix_collect' => array(
1432 1432
 				'index' => 'id_report',
1433
-				'process' => function ($reports)
1433
+				'process' => function($reports)
1434 1434
 				{
1435 1435
 					global $smcFunc;
1436 1436
 					$smcFunc['db_query']('', '
@@ -1460,7 +1460,7 @@  discard block
 block discarded – undo
1460 1460
 				GROUP BY lgr.id_member',
1461 1461
 			'fix_collect' => array(
1462 1462
 				'index' => 'id_member',
1463
-				'process' => function ($members)
1463
+				'process' => function($members)
1464 1464
 				{
1465 1465
 					global $smcFunc;
1466 1466
 					$smcFunc['db_query']('', '
@@ -1490,7 +1490,7 @@  discard block
 block discarded – undo
1490 1490
 				GROUP BY lgr.id_group',
1491 1491
 			'fix_collect' => array(
1492 1492
 				'index' => 'id_group',
1493
-				'process' => function ($groups)
1493
+				'process' => function($groups)
1494 1494
 				{
1495 1495
 					global $smcFunc;
1496 1496
 					$smcFunc['db_query']('', '
Please login to merge, or discard this patch.
Sources/QueryString.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -454,7 +454,7 @@
 block discarded – undo
454 454
 			break;
455 455
 		}
456 456
 		$binMask = str_pad($binMask, 32, '0');
457
-		$binMask = pack("H*" , $binMask);
457
+		$binMask = pack("H*", $binMask);
458 458
 
459 459
 		return ($ip_address & $binMask) == $cidr_network;
460 460
 	}
Please login to merge, or discard this patch.
Sources/Search.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
 
660 660
 	// Remove the phrase parts and extract the words.
661 661
 	$wordArray = preg_replace('~(?:^|\s)(?:[-]?)"(?:[^"]+)"(?:$|\s)~' . ($context['utf8'] ? 'u' : ''), ' ', $search_params['search']);
662
-	$wordArray = explode(' ',  $smcFunc['htmlspecialchars'](un_htmlspecialchars($wordArray), ENT_QUOTES));
662
+	$wordArray = explode(' ', $smcFunc['htmlspecialchars'](un_htmlspecialchars($wordArray), ENT_QUOTES));
663 663
 
664 664
 	// A minus sign in front of a word excludes the word.... so...
665 665
 	$excludedWords = array();
@@ -1102,7 +1102,7 @@  discard block
 block discarded – undo
1102 1102
 						SELECT
1103 1103
 							{int:id_search},
1104 1104
 							t.id_topic,
1105
-							' . $relevance. ',
1105
+							' . $relevance . ',
1106 1106
 							' . (empty($userQuery) ? 't.id_first_msg' : 'm.id_msg') . ',
1107 1107
 							1
1108 1108
 						FROM ' . $subject_query['from'] . (empty($subject_query['inner_join']) ? '' : '
@@ -1335,7 +1335,7 @@  discard block
 block discarded – undo
1335 1335
 						if (empty($subject_query['where']))
1336 1336
 							continue;
1337 1337
 
1338
-						$ignoreRequest = $smcFunc['db_search_query']('insert_log_search_topics', ($smcFunc['db_support_ignore'] ? ( '
1338
+						$ignoreRequest = $smcFunc['db_search_query']('insert_log_search_topics', ($smcFunc['db_support_ignore'] ? ('
1339 1339
 							INSERT IGNORE INTO {db_prefix}' . ($createTemporary ? 'tmp_' : '') . 'log_search_topics
1340 1340
 								(' . ($createTemporary ? '' : 'id_search, ') . 'id_topic)') : '') . '
1341 1341
 							SELECT ' . ($createTemporary ? '' : $_SESSION['search_cache']['id_search'] . ', ') . 't.id_topic
@@ -1562,7 +1562,7 @@  discard block
 block discarded – undo
1562 1562
 					}
1563 1563
 					$main_query['select']['relevance'] = substr($relevance, 0, -3) . ') / ' . $new_weight_total . ' AS relevance';
1564 1564
 
1565
-					$ignoreRequest = $smcFunc['db_search_query']('insert_log_search_results_no_index', ($smcFunc['db_support_ignore'] ? ( '
1565
+					$ignoreRequest = $smcFunc['db_search_query']('insert_log_search_results_no_index', ($smcFunc['db_support_ignore'] ? ('
1566 1566
 						INSERT IGNORE INTO ' . '{db_prefix}log_search_results
1567 1567
 							(' . implode(', ', array_keys($main_query['select'])) . ')') : '') . '
1568 1568
 						SELECT
@@ -1630,7 +1630,7 @@  discard block
 block discarded – undo
1630 1630
 					$relevance = substr($relevance, 0, -3) . ') / ' . $weight_total . ' AS relevance';
1631 1631
 
1632 1632
 					$usedIDs = array_flip(empty($inserts) ? array() : array_keys($inserts));
1633
-					$ignoreRequest = $smcFunc['db_search_query']('insert_log_search_results_sub_only', ($smcFunc['db_support_ignore'] ? ( '
1633
+					$ignoreRequest = $smcFunc['db_search_query']('insert_log_search_results_sub_only', ($smcFunc['db_support_ignore'] ? ('
1634 1634
 						INSERT IGNORE INTO {db_prefix}log_search_results
1635 1635
 							(id_search, id_topic, relevance, id_msg, num_matches)') : '') . '
1636 1636
 						SELECT
@@ -2099,7 +2099,7 @@  discard block
 block discarded – undo
2099 2099
 		if (strlen($query) == 0)
2100 2100
 			continue;
2101 2101
 
2102
-		$body_highlighted = preg_replace_callback('/((<[^>]*)|' . preg_quote(strtr($query, array('\'' => '&#039;')), '/') . ')/i' . ($context['utf8'] ? 'u' : ''), function ($m)
2102
+		$body_highlighted = preg_replace_callback('/((<[^>]*)|' . preg_quote(strtr($query, array('\'' => '&#039;')), '/') . ')/i' . ($context['utf8'] ? 'u' : ''), function($m)
2103 2103
 		{
2104 2104
 			return isset($m[2]) && "$m[2]" == "$m[1]" ? stripslashes("$m[1]") : "<strong class=\"highlight\">$m[1]</strong>";
2105 2105
 		}, $body_highlighted);
Please login to merge, or discard this patch.