Completed
Push — release-2.1 ( 9bc16d...efe294 )
by Mathias
20s
created
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/ManageLanguages.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1229,8 +1229,8 @@
 block discarded – undo
1229 1229
 					continue;
1230 1230
 
1231 1231
 				$final_saves[$string_key] = array(
1232
-					'find' => "\n\n?".'>',
1233
-					'replace' => "\n$" . $type . '[\'' . $string_key . '\'] = ' . $string_val['string'] . ';' . "\n\n?".'>',
1232
+					'find' => "\n\n?" . '>',
1233
+					'replace' => "\n$" . $type . '[\'' . $string_key . '\'] = ' . $string_val['string'] . ';' . "\n\n?" . '>',
1234 1234
 				);
1235 1235
 			}
1236 1236
 		}
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.
Sources/Errors.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
 		$backtrace = debug_backtrace();
46 46
 
47 47
 	// are we in a loop?
48
-	if($error_call > 2)
48
+	if ($error_call > 2)
49 49
 	{
50 50
 		var_dump($backtrace);
51 51
 		die('Error loop.');
Please login to merge, or discard this patch.
Sources/Subs-Db-mysql.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -254,8 +254,8 @@  discard block
 block discarded – undo
254 254
 
255 255
 		case 'datetime':
256 256
 			if (preg_match('~^(\d{4})-([0-1]?\d)-([0-3]?\d) ([0-1]?\d|2[0-3]):([0-5]\d):([0-5]\d)$~', $replacement, $datetime_matches) === 1)
257
-				return 'str_to_date('.
258
-					sprintf('\'%04d-%02d-%02d %02d:%02d:%02d\'', $datetime_matches[1], $datetime_matches[2], $datetime_matches[3], $datetime_matches[4], $datetime_matches[5] ,$datetime_matches[6]).
257
+				return 'str_to_date(' .
258
+					sprintf('\'%04d-%02d-%02d %02d:%02d:%02d\'', $datetime_matches[1], $datetime_matches[2], $datetime_matches[3], $datetime_matches[4], $datetime_matches[5], $datetime_matches[6]) .
259 259
 					',\'%Y-%m-%d %h:%i:%s\')';
260 260
 			else
261 261
 				smf_db_error_backtrace('Wrong value type sent to the database. Datetime expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 		$old_pos = 0;
407 407
 		$pos = -1;
408 408
 		// Remove the string escape for better runtime
409
-		$db_string_1 = str_replace('\\\'','',$db_string);
409
+		$db_string_1 = str_replace('\\\'', '', $db_string);
410 410
 		while (true)
411 411
 		{
412 412
 			$pos = strpos($db_string_1, '\'', $pos + 1);
@@ -787,7 +787,7 @@  discard block
 block discarded – undo
787 787
 	{
788 788
 		$count = count($insertRows);
789 789
 		$ai = 0;
790
-		for($i = 0; $i < $count; $i++)
790
+		for ($i = 0; $i < $count; $i++)
791 791
 		{
792 792
 			$old_id = $smcFunc['db_insert_id']();
793 793
 
@@ -813,13 +813,13 @@  discard block
 block discarded – undo
813 813
 				$count2 = count($indexed_columns);
814 814
 				for ($x = 0; $x < $count2; $x++)
815 815
 				{
816
-					$where_string += key($indexed_columns[$x]) . ' = '. $insertRows[$i][$x];
816
+					$where_string += key($indexed_columns[$x]) . ' = ' . $insertRows[$i][$x];
817 817
 					if (($x + 1) < $count2)
818 818
 						$where_string += ' AND ';
819 819
 				}
820 820
 
821
-				$request = $smcFunc['db_query']('','
822
-					SELECT `'. $keys[0] . '` FROM ' . $table .'
821
+				$request = $smcFunc['db_query']('', '
822
+					SELECT `'. $keys[0] . '` FROM ' . $table . '
823 823
 					WHERE ' . $where_string . ' LIMIT 1',
824 824
 					array()
825 825
 				);
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
 			$return_var = array();
849 849
 			$count = count($insertRows);
850 850
 			$start = smf_db_insert_id($table, $keys[0]);
851
-			for ($i = 0; $i < $count; $i++ )
851
+			for ($i = 0; $i < $count; $i++)
852 852
 				$return_var[] = $start + $i;
853 853
 		}
854 854
 		return $return_var;
@@ -985,7 +985,7 @@  discard block
 block discarded – undo
985 985
 	mysqli_stmt_bind_param($mysql_error_data_prep, 'iissssssis',
986 986
 		$error_array[0], $error_array[1], $error_array[2], $error_array[3], $error_array[4], $error_array[5], $error_array[6],
987 987
 		$error_array[7], $error_array[8], $error_array[9]);
988
-	mysqli_stmt_execute ($mysql_error_data_prep);
988
+	mysqli_stmt_execute($mysql_error_data_prep);
989 989
 }
990 990
 
991 991
 /**
@@ -999,7 +999,7 @@  discard block
 block discarded – undo
999 999
  */
1000 1000
 function smf_db_custom_order($field, $array_values, $desc = false)
1001 1001
 {
1002
-	$return = 'CASE '. $field . ' ';
1002
+	$return = 'CASE ' . $field . ' ';
1003 1003
 	$count = count($array_values);
1004 1004
 	$then = ($desc ? ' THEN -' : ' THEN ');
1005 1005
 
Please login to merge, or discard this patch.