Passed
Pull Request — release-2.1 (#5160)
by John
05:13
created
Sources/Search.php 1 patch
Spacing   +7 added lines, -7 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();
@@ -991,7 +991,7 @@  discard block
 block discarded – undo
991 991
 		// Are the result fresh?
992 992
 		if (!$update_cache && !empty($_SESSION['search_cache']['id_search']))
993 993
 		{
994
-			$request = $smcFunc['db_query']('','
994
+			$request = $smcFunc['db_query']('', '
995 995
 				SELECT id_search
996 996
 				FROM {db_prefix}log_search_results
997 997
 				WHERE id_search = {int:search_id}
@@ -1113,7 +1113,7 @@  discard block
 block discarded – undo
1113 1113
 						SELECT
1114 1114
 							{int:id_search},
1115 1115
 							t.id_topic,
1116
-							' . $relevance. ',
1116
+							' . $relevance . ',
1117 1117
 							' . (empty($userQuery) ? 't.id_first_msg' : 'm.id_msg') . ',
1118 1118
 							1
1119 1119
 						FROM ' . $subject_query['from'] . (empty($subject_query['inner_join']) ? '' : '
@@ -1346,7 +1346,7 @@  discard block
 block discarded – undo
1346 1346
 						if (empty($subject_query['where']))
1347 1347
 							continue;
1348 1348
 
1349
-						$ignoreRequest = $smcFunc['db_search_query']('insert_log_search_topics', ($smcFunc['db_support_ignore'] ? ( '
1349
+						$ignoreRequest = $smcFunc['db_search_query']('insert_log_search_topics', ($smcFunc['db_support_ignore'] ? ('
1350 1350
 							INSERT IGNORE INTO {db_prefix}' . ($createTemporary ? 'tmp_' : '') . 'log_search_topics
1351 1351
 								(' . ($createTemporary ? '' : 'id_search, ') . 'id_topic)') : '') . '
1352 1352
 							SELECT ' . ($createTemporary ? '' : $_SESSION['search_cache']['id_search'] . ', ') . 't.id_topic
@@ -1573,7 +1573,7 @@  discard block
 block discarded – undo
1573 1573
 					}
1574 1574
 					$main_query['select']['relevance'] = substr($relevance, 0, -3) . ') / ' . $new_weight_total . ' AS relevance';
1575 1575
 
1576
-					$ignoreRequest = $smcFunc['db_search_query']('insert_log_search_results_no_index', ($smcFunc['db_support_ignore'] ? ( '
1576
+					$ignoreRequest = $smcFunc['db_search_query']('insert_log_search_results_no_index', ($smcFunc['db_support_ignore'] ? ('
1577 1577
 						INSERT IGNORE INTO ' . '{db_prefix}log_search_results
1578 1578
 							(' . implode(', ', array_keys($main_query['select'])) . ')') : '') . '
1579 1579
 						SELECT
@@ -1641,7 +1641,7 @@  discard block
 block discarded – undo
1641 1641
 					$relevance = substr($relevance, 0, -3) . ') / ' . $weight_total . ' AS relevance';
1642 1642
 
1643 1643
 					$usedIDs = array_flip(empty($inserts) ? array() : array_keys($inserts));
1644
-					$ignoreRequest = $smcFunc['db_search_query']('insert_log_search_results_sub_only', ($smcFunc['db_support_ignore'] ? ( '
1644
+					$ignoreRequest = $smcFunc['db_search_query']('insert_log_search_results_sub_only', ($smcFunc['db_support_ignore'] ? ('
1645 1645
 						INSERT IGNORE INTO {db_prefix}log_search_results
1646 1646
 							(id_search, id_topic, relevance, id_msg, num_matches)') : '') . '
1647 1647
 						SELECT
@@ -2110,7 +2110,7 @@  discard block
 block discarded – undo
2110 2110
 		if (strlen($query) == 0)
2111 2111
 			continue;
2112 2112
 
2113
-		$body_highlighted = preg_replace_callback('/((<[^>]*)|' . preg_quote(strtr($query, array('\'' => '&#039;')), '/') . ')/i' . ($context['utf8'] ? 'u' : ''), function ($m)
2113
+		$body_highlighted = preg_replace_callback('/((<[^>]*)|' . preg_quote(strtr($query, array('\'' => '&#039;')), '/') . ')/i' . ($context['utf8'] ? 'u' : ''), function($m)
2114 2114
 		{
2115 2115
 			return isset($m[2]) && "$m[2]" == "$m[1]" ? stripslashes("$m[1]") : "<strong class=\"highlight\">$m[1]</strong>";
2116 2116
 		}, $body_highlighted);
Please login to merge, or discard this patch.