Completed
Push — release-2.1 ( 9fa566...084464 )
by Colin
17:59 queued 10:04
created
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/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.
Sources/Subs.php 1 patch
Spacing   +112 added lines, -112 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
 			}
@@ -739,7 +739,7 @@  discard block
 block discarded – undo
739 739
 	static $non_twelve_hour, $locale_cache;
740 740
 	static $unsupportedFormats, $finalizedFormats;
741 741
 
742
-	$unsupportedFormatsWindows = array('z','Z');
742
+	$unsupportedFormatsWindows = array('z', 'Z');
743 743
 
744 744
 	// Ensure required values are set
745 745
 	$user_info['time_offset'] = !empty($user_info['time_offset']) ? $user_info['time_offset'] : 0;
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
 			$unsupportedFormats = (array) cache_get_data('unsupportedtimeformats', 86400);
825 825
 		if (empty($unsupportedFormats))
826 826
 		{
827
-			foreach($strftimeFormatSubstitutions as $format => $substitution)
827
+			foreach ($strftimeFormatSubstitutions as $format => $substitution)
828 828
 			{
829 829
 				// Avoid a crashing bug with PHP 7 on certain versions of Windows
830 830
 				if ($context['server']['is_windows'] && in_array($format, $unsupportedFormatsWindows))
@@ -1196,7 +1196,7 @@  discard block
 block discarded – undo
1196 1196
 					'height' => array('optional' => true, 'match' => '(\d+)'),
1197 1197
 				),
1198 1198
 				'content' => '$1',
1199
-				'validate' => function (&$tag, &$data, $disabled, $params) use ($modSettings, $context, $sourcedir, $txt)
1199
+				'validate' => function(&$tag, &$data, $disabled, $params) use ($modSettings, $context, $sourcedir, $txt)
1200 1200
 				{
1201 1201
 					$returnContext = '';
1202 1202
 
@@ -1231,7 +1231,7 @@  discard block
 block discarded – undo
1231 1231
 						}
1232 1232
 
1233 1233
 						if ($currentAttachment['thumbnail']['has_thumb'] && empty($params['{width}']) && empty($params['{height}']))
1234
-							$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>';
1234
+							$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>';
1235 1235
 						else
1236 1236
 							$returnContext .= '<img src="' . $currentAttachment['href'] . ';image"' . $alt . $title . $width . $height . ' class="bbc_img"/>';
1237 1237
 					}
@@ -1260,7 +1260,7 @@  discard block
 block discarded – undo
1260 1260
 				'type' => 'unparsed_content',
1261 1261
 				'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>',
1262 1262
 				// @todo Maybe this can be simplified?
1263
-				'validate' => isset($disabled['code']) ? null : function (&$tag, &$data, $disabled) use ($context)
1263
+				'validate' => isset($disabled['code']) ? null : function(&$tag, &$data, $disabled) use ($context)
1264 1264
 				{
1265 1265
 					if (!isset($disabled['code']))
1266 1266
 					{
@@ -1297,7 +1297,7 @@  discard block
 block discarded – undo
1297 1297
 				'type' => 'unparsed_equals_content',
1298 1298
 				'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>',
1299 1299
 				// @todo Maybe this can be simplified?
1300
-				'validate' => isset($disabled['code']) ? null : function (&$tag, &$data, $disabled) use ($context)
1300
+				'validate' => isset($disabled['code']) ? null : function(&$tag, &$data, $disabled) use ($context)
1301 1301
 				{
1302 1302
 					if (!isset($disabled['code']))
1303 1303
 					{
@@ -1341,7 +1341,7 @@  discard block
 block discarded – undo
1341 1341
 				'type' => 'unparsed_content',
1342 1342
 				'content' => '<a href="mailto:$1" class="bbc_email">$1</a>',
1343 1343
 				// @todo Should this respect guest_hideContacts?
1344
-				'validate' => function (&$tag, &$data, $disabled)
1344
+				'validate' => function(&$tag, &$data, $disabled)
1345 1345
 				{
1346 1346
 					$data = strtr($data, array('<br>' => ''));
1347 1347
 				},
@@ -1360,7 +1360,7 @@  discard block
 block discarded – undo
1360 1360
 				'type' => 'unparsed_commas_content',
1361 1361
 				'test' => '\d+,\d+\]',
1362 1362
 				'content' => '<embed type="application/x-shockwave-flash" src="$1" width="$2" height="$3" play="true" loop="true" quality="high" AllowScriptAccess="never">',
1363
-				'validate' => function (&$tag, &$data, $disabled)
1363
+				'validate' => function(&$tag, &$data, $disabled)
1364 1364
 				{
1365 1365
 					if (isset($disabled['url']))
1366 1366
 						$tag['content'] = '$1';
@@ -1376,7 +1376,7 @@  discard block
 block discarded – undo
1376 1376
 				'test' => '(left|right)(\s+max=\d+(?:%|px|em|rem|ex|pt|pc|ch|vw|vh|vmin|vmax|cm|mm|in)?)?\]',
1377 1377
 				'before' => '<div $1>',
1378 1378
 				'after' => '</div>',
1379
-				'validate' => function (&$tag, &$data, $disabled)
1379
+				'validate' => function(&$tag, &$data, $disabled)
1380 1380
 				{
1381 1381
 					$class = 'class="bbc_float float' . (strpos($data, 'left') === 0 ? 'left' : 'right') . '"';
1382 1382
 
@@ -1425,7 +1425,7 @@  discard block
 block discarded – undo
1425 1425
 					'height' => array('optional' => true, 'value' => ' height="$1"', 'match' => '(\d+)'),
1426 1426
 				),
1427 1427
 				'content' => '<img src="$1" alt="{alt}" title="{title}"{width}{height} class="bbc_img resized">',
1428
-				'validate' => function (&$tag, &$data, $disabled)
1428
+				'validate' => function(&$tag, &$data, $disabled)
1429 1429
 				{
1430 1430
 					global $image_proxy_enabled, $user_info;
1431 1431
 
@@ -1451,7 +1451,7 @@  discard block
 block discarded – undo
1451 1451
 				'tag' => 'img',
1452 1452
 				'type' => 'unparsed_content',
1453 1453
 				'content' => '<img src="$1" alt="" class="bbc_img">',
1454
-				'validate' => function (&$tag, &$data, $disabled)
1454
+				'validate' => function(&$tag, &$data, $disabled)
1455 1455
 				{
1456 1456
 					global $image_proxy_enabled, $user_info;
1457 1457
 
@@ -1477,7 +1477,7 @@  discard block
 block discarded – undo
1477 1477
 				'tag' => 'iurl',
1478 1478
 				'type' => 'unparsed_content',
1479 1479
 				'content' => '<a href="$1" class="bbc_link">$1</a>',
1480
-				'validate' => function (&$tag, &$data, $disabled)
1480
+				'validate' => function(&$tag, &$data, $disabled)
1481 1481
 				{
1482 1482
 					$data = strtr($data, array('<br>' => ''));
1483 1483
 					$scheme = parse_url($data, PHP_URL_SCHEME);
@@ -1491,7 +1491,7 @@  discard block
 block discarded – undo
1491 1491
 				'quoted' => 'optional',
1492 1492
 				'before' => '<a href="$1" class="bbc_link">',
1493 1493
 				'after' => '</a>',
1494
-				'validate' => function (&$tag, &$data, $disabled)
1494
+				'validate' => function(&$tag, &$data, $disabled)
1495 1495
 				{
1496 1496
 					if (substr($data, 0, 1) == '#')
1497 1497
 						$data = '#post_' . substr($data, 1);
@@ -1577,7 +1577,7 @@  discard block
 block discarded – undo
1577 1577
 				'tag' => 'php',
1578 1578
 				'type' => 'unparsed_content',
1579 1579
 				'content' => '<span class="phpcode">$1</span>',
1580
-				'validate' => isset($disabled['php']) ? null : function (&$tag, &$data, $disabled)
1580
+				'validate' => isset($disabled['php']) ? null : function(&$tag, &$data, $disabled)
1581 1581
 				{
1582 1582
 					if (!isset($disabled['php']))
1583 1583
 					{
@@ -1675,7 +1675,7 @@  discard block
 block discarded – undo
1675 1675
 				'test' => '[1-7]\]',
1676 1676
 				'before' => '<span style="font-size: $1;" class="bbc_size">',
1677 1677
 				'after' => '</span>',
1678
-				'validate' => function (&$tag, &$data, $disabled)
1678
+				'validate' => function(&$tag, &$data, $disabled)
1679 1679
 				{
1680 1680
 					$sizes = array(1 => 0.7, 2 => 1.0, 3 => 1.35, 4 => 1.45, 5 => 2.0, 6 => 2.65, 7 => 3.95);
1681 1681
 					$data = $sizes[$data] . 'em';
@@ -1713,7 +1713,7 @@  discard block
 block discarded – undo
1713 1713
 				'tag' => 'time',
1714 1714
 				'type' => 'unparsed_content',
1715 1715
 				'content' => '$1',
1716
-				'validate' => function (&$tag, &$data, $disabled)
1716
+				'validate' => function(&$tag, &$data, $disabled)
1717 1717
 				{
1718 1718
 					if (is_numeric($data))
1719 1719
 						$data = timeformat($data);
@@ -1741,7 +1741,7 @@  discard block
 block discarded – undo
1741 1741
 				'tag' => 'url',
1742 1742
 				'type' => 'unparsed_content',
1743 1743
 				'content' => '<a href="$1" class="bbc_link" target="_blank" rel="noopener">$1</a>',
1744
-				'validate' => function (&$tag, &$data, $disabled)
1744
+				'validate' => function(&$tag, &$data, $disabled)
1745 1745
 				{
1746 1746
 					$data = strtr($data, array('<br>' => ''));
1747 1747
 					$scheme = parse_url($data, PHP_URL_SCHEME);
@@ -1755,7 +1755,7 @@  discard block
 block discarded – undo
1755 1755
 				'quoted' => 'optional',
1756 1756
 				'before' => '<a href="$1" class="bbc_link" target="_blank" rel="noopener">',
1757 1757
 				'after' => '</a>',
1758
-				'validate' => function (&$tag, &$data, $disabled)
1758
+				'validate' => function(&$tag, &$data, $disabled)
1759 1759
 				{
1760 1760
 					$scheme = parse_url($data, PHP_URL_SCHEME);
1761 1761
 					if (empty($scheme))
@@ -1787,7 +1787,7 @@  discard block
 block discarded – undo
1787 1787
 		{
1788 1788
 			if (isset($temp_bbc))
1789 1789
 				$bbc_codes = $temp_bbc;
1790
-			usort($codes, function ($a, $b) {
1790
+			usort($codes, function($a, $b) {
1791 1791
 				return strcmp($a['tag'], $b['tag']);
1792 1792
 			});
1793 1793
 			return $codes;
@@ -2003,7 +2003,7 @@  discard block
 block discarded – undo
2003 2003
 										# a run of Unicode domain name characters and a dot
2004 2004
 										[\p{L}\p{M}\p{N}\-.:@]+\.
2005 2005
 										# and then a TLD valid in the DNS or the reserved "local" TLD
2006
-										(?:'. $modSettings['tld_regex'] .'|local)
2006
+										(?:'. $modSettings['tld_regex'] . '|local)
2007 2007
 									)
2008 2008
 									# followed by a non-domain character or end of line
2009 2009
 									(?=[^\p{L}\p{N}\-.]|$)
@@ -2071,7 +2071,7 @@  discard block
 block discarded – undo
2071 2071
 						)?
2072 2072
 						';
2073 2073
 
2074
-						$data = preg_replace_callback('~' . $url_regex . '~xi' . ($context['utf8'] ? 'u' : ''), function ($matches) {
2074
+						$data = preg_replace_callback('~' . $url_regex . '~xi' . ($context['utf8'] ? 'u' : ''), function($matches) {
2075 2075
 							$url = array_shift($matches);
2076 2076
 
2077 2077
 							// If this isn't a clean URL, bail out
@@ -2096,7 +2096,7 @@  discard block
 block discarded – undo
2096 2096
 								$fullUrl = $url;
2097 2097
 
2098 2098
 							// Make sure that $fullUrl really is valid
2099
-							if (validate_iri((strpos($fullUrl, '//') === 0 ? 'http:' : '' ) . $fullUrl) === false)
2099
+							if (validate_iri((strpos($fullUrl, '//') === 0 ? 'http:' : '') . $fullUrl) === false)
2100 2100
 								return $url;
2101 2101
 
2102 2102
 							return '[url=&quot;' . str_replace(array('[', ']'), array('&#91;', '&#93;'), $fullUrl) . '&quot;]' . $url . '[/url]';
@@ -2160,7 +2160,7 @@  discard block
 block discarded – undo
2160 2160
 			$look_for = strtolower(substr($message, $pos + 2, $pos2 - $pos - 2));
2161 2161
 
2162 2162
 			// A closing tag that doesn't match any open tags? Skip it.
2163
-			if (!in_array($look_for, array_map(function($code){return $code['tag'];}, $open_tags)))
2163
+			if (!in_array($look_for, array_map(function($code) {return $code['tag']; }, $open_tags)))
2164 2164
 				continue;
2165 2165
 
2166 2166
 			$to_close = array();
@@ -2830,7 +2830,7 @@  discard block
 block discarded – undo
2830 2830
 			{
2831 2831
 				$exts = array('svg', 'png', 'gif', 'jpg');
2832 2832
 				$fname = pathinfo($smileysto[$i], PATHINFO_FILENAME);
2833
-				$alt_images = glob($smileys_dir . $fname .  '.{' . (implode(',', $exts)) . '}', GLOB_BRACE);
2833
+				$alt_images = glob($smileys_dir . $fname . '.{' . (implode(',', $exts)) . '}', GLOB_BRACE);
2834 2834
 				if (!empty($alt_images))
2835 2835
 				{
2836 2836
 					foreach ($exts as $ext)
@@ -2846,7 +2846,7 @@  discard block
 block discarded – undo
2846 2846
 			}
2847 2847
 
2848 2848
 			$specialChars = $smcFunc['htmlspecialchars']($smileysfrom[$i], ENT_QUOTES);
2849
-			$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">';
2849
+			$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">';
2850 2850
 
2851 2851
 			$smileyPregReplacements[$smileysfrom[$i]] = $smileyCode;
2852 2852
 
@@ -2863,7 +2863,7 @@  discard block
 block discarded – undo
2863 2863
 
2864 2864
 	// Replace away!
2865 2865
 	$message = preg_replace_callback($smileyPregSearch,
2866
-		function ($matches) use ($smileyPregReplacements)
2866
+		function($matches) use ($smileyPregReplacements)
2867 2867
 		{
2868 2868
 			return $smileyPregReplacements[$matches[1]];
2869 2869
 		}, $message);
@@ -2960,13 +2960,13 @@  discard block
 block discarded – undo
2960 2960
 	{
2961 2961
 		if (defined('SID') && SID != '')
2962 2962
 			$setLocation = preg_replace_callback('~^' . preg_quote($scripturl, '~') . '\?(?:' . SID . '(?:;|&|&amp;))((?:board|topic)=[^#]+?)(#[^"]*?)?$~',
2963
-				function ($m) use ($scripturl)
2963
+				function($m) use ($scripturl)
2964 2964
 				{
2965
-					return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html?' . SID. (isset($m[2]) ? "$m[2]" : "");
2965
+					return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html?' . SID . (isset($m[2]) ? "$m[2]" : "");
2966 2966
 				}, $setLocation);
2967 2967
 		else
2968 2968
 			$setLocation = preg_replace_callback('~^' . preg_quote($scripturl, '~') . '\?((?:board|topic)=[^#"]+?)(#[^"]*?)?$~',
2969
-				function ($m) use ($scripturl)
2969
+				function($m) use ($scripturl)
2970 2970
 				{
2971 2971
 					return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html' . (isset($m[2]) ? "$m[2]" : "");
2972 2972
 				}, $setLocation);
@@ -3287,7 +3287,7 @@  discard block
 block discarded – undo
3287 3287
 
3288 3288
 	// Add a generic "Are you sure?" confirmation message.
3289 3289
 	addInlineJavaScript('
3290
-	var smf_you_sure =' . JavaScriptEscape($txt['quickmod_confirm']) .';');
3290
+	var smf_you_sure =' . JavaScriptEscape($txt['quickmod_confirm']) . ';');
3291 3291
 
3292 3292
 	// Now add the capping code for avatars.
3293 3293
 	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')
@@ -3753,7 +3753,7 @@  discard block
 block discarded – undo
3753 3753
 	if (!empty($normal))
3754 3754
 		foreach ($normal as $nf)
3755 3755
 			echo '
3756
-	<link rel="stylesheet" href="', $nf ,'">';
3756
+	<link rel="stylesheet" href="', $nf, '">';
3757 3757
 
3758 3758
 	if ($db_show_debug === true)
3759 3759
 	{
@@ -3769,7 +3769,7 @@  discard block
 block discarded – undo
3769 3769
 	<style>';
3770 3770
 
3771 3771
 		foreach ($context['css_header'] as $css)
3772
-			echo $css .'
3772
+			echo $css . '
3773 3773
 	';
3774 3774
 
3775 3775
 		echo'
@@ -3813,7 +3813,7 @@  discard block
 block discarded – undo
3813 3813
 
3814 3814
 
3815 3815
 	// No namespaces, sorry!
3816
-	$classType = 'MatthiasMullie\\Minify\\'. strtoupper($type);
3816
+	$classType = 'MatthiasMullie\\Minify\\' . strtoupper($type);
3817 3817
 
3818 3818
 	// Temp path.
3819 3819
 	$cTempPath = $settings['theme_dir'] . '/' . ($type == 'css' ? 'css' : 'scripts') . '/';
@@ -3993,7 +3993,7 @@  discard block
 block discarded – undo
3993 3993
 	else
3994 3994
 		$path = $modSettings['attachmentUploadDir'];
3995 3995
 
3996
-	return $path . '/' . $attachment_id . '_' . $file_hash .'.dat';
3996
+	return $path . '/' . $attachment_id . '_' . $file_hash . '.dat';
3997 3997
 }
3998 3998
 
3999 3999
 /**
@@ -4037,10 +4037,10 @@  discard block
 block discarded – undo
4037 4037
 		$valid_low = isValidIP($ip_parts[0]);
4038 4038
 		$valid_high = isValidIP($ip_parts[1]);
4039 4039
 		$count = 0;
4040
-		$mode = (preg_match('/:/',$ip_parts[0]) > 0 ? ':' : '.');
4040
+		$mode = (preg_match('/:/', $ip_parts[0]) > 0 ? ':' : '.');
4041 4041
 		$max = ($mode == ':' ? 'ffff' : '255');
4042 4042
 		$min = 0;
4043
-		if(!$valid_low)
4043
+		if (!$valid_low)
4044 4044
 		{
4045 4045
 			$ip_parts[0] = preg_replace('/\*/', '0', $ip_parts[0]);
4046 4046
 			$valid_low = isValidIP($ip_parts[0]);
@@ -4054,7 +4054,7 @@  discard block
 block discarded – undo
4054 4054
 		}
4055 4055
 
4056 4056
 		$count = 0;
4057
-		if(!$valid_high)
4057
+		if (!$valid_high)
4058 4058
 		{
4059 4059
 			$ip_parts[1] = preg_replace('/\*/', $max, $ip_parts[1]);
4060 4060
 			$valid_high = isValidIP($ip_parts[1]);
@@ -4067,7 +4067,7 @@  discard block
 block discarded – undo
4067 4067
 			}
4068 4068
 		}
4069 4069
 
4070
-		if($valid_high && $valid_low)
4070
+		if ($valid_high && $valid_low)
4071 4071
 		{
4072 4072
 			$ip_array['low'] = $ip_parts[0];
4073 4073
 			$ip_array['high'] = $ip_parts[1];
@@ -4248,7 +4248,7 @@  discard block
 block discarded – undo
4248 4248
 		addInlineJavaScript('
4249 4249
 	var user_menus = new smc_PopupMenu();
4250 4250
 	user_menus.add("profile", "' . $scripturl . '?action=profile;area=popup");
4251
-	user_menus.add("alerts", "' . $scripturl . '?action=profile;area=alerts_popup;u='. $context['user']['id'] .'");', true);
4251
+	user_menus.add("alerts", "' . $scripturl . '?action=profile;area=alerts_popup;u=' . $context['user']['id'] . '");', true);
4252 4252
 		if ($context['allow_pm'])
4253 4253
 			addInlineJavaScript('
4254 4254
 	user_menus.add("pm", "' . $scripturl . '?action=pm;sa=popup");', true);
@@ -4884,7 +4884,7 @@  discard block
 block discarded – undo
4884 4884
 		// No? try a fallback to $sourcedir
4885 4885
 		else
4886 4886
 		{
4887
-			$absPath = $sourcedir .'/'. $file;
4887
+			$absPath = $sourcedir . '/' . $file;
4888 4888
 
4889 4889
 			if (file_exists($absPath))
4890 4890
 				require_once($absPath);
@@ -5151,15 +5151,15 @@  discard block
 block discarded – undo
5151 5151
 
5152 5152
 	// UTF-8 occurences of MS special characters
5153 5153
 	$findchars_utf8 = array(
5154
-		"\xe2\x80\x9a",	// single low-9 quotation mark
5155
-		"\xe2\x80\x9e",	// double low-9 quotation mark
5156
-		"\xe2\x80\xa6",	// horizontal ellipsis
5157
-		"\xe2\x80\x98",	// left single curly quote
5158
-		"\xe2\x80\x99",	// right single curly quote
5159
-		"\xe2\x80\x9c",	// left double curly quote
5160
-		"\xe2\x80\x9d",	// right double curly quote
5161
-		"\xe2\x80\x93",	// en dash
5162
-		"\xe2\x80\x94",	// em dash
5154
+		"\xe2\x80\x9a", // single low-9 quotation mark
5155
+		"\xe2\x80\x9e", // double low-9 quotation mark
5156
+		"\xe2\x80\xa6", // horizontal ellipsis
5157
+		"\xe2\x80\x98", // left single curly quote
5158
+		"\xe2\x80\x99", // right single curly quote
5159
+		"\xe2\x80\x9c", // left double curly quote
5160
+		"\xe2\x80\x9d", // right double curly quote
5161
+		"\xe2\x80\x93", // en dash
5162
+		"\xe2\x80\x94", // em dash
5163 5163
 	);
5164 5164
 
5165 5165
 	// windows 1252 / iso equivalents
@@ -5177,15 +5177,15 @@  discard block
 block discarded – undo
5177 5177
 
5178 5178
 	// safe replacements
5179 5179
 	$replacechars = array(
5180
-		',',	// &sbquo;
5181
-		',,',	// &bdquo;
5182
-		'...',	// &hellip;
5183
-		"'",	// &lsquo;
5184
-		"'",	// &rsquo;
5185
-		'"',	// &ldquo;
5186
-		'"',	// &rdquo;
5187
-		'-',	// &ndash;
5188
-		'--',	// &mdash;
5180
+		',', // &sbquo;
5181
+		',,', // &bdquo;
5182
+		'...', // &hellip;
5183
+		"'", // &lsquo;
5184
+		"'", // &rsquo;
5185
+		'"', // &ldquo;
5186
+		'"', // &rdquo;
5187
+		'-', // &ndash;
5188
+		'--', // &mdash;
5189 5189
 	);
5190 5190
 
5191 5191
 	if ($context['utf8'])
@@ -5505,7 +5505,7 @@  discard block
 block discarded – undo
5505 5505
  */
5506 5506
 function inet_dtop($bin)
5507 5507
 {
5508
-	if(empty($bin))
5508
+	if (empty($bin))
5509 5509
 		return '';
5510 5510
 
5511 5511
 	global $db_type;
@@ -5536,28 +5536,28 @@  discard block
 block discarded – undo
5536 5536
  */
5537 5537
 function _safe_serialize($value)
5538 5538
 {
5539
-	if(is_null($value))
5539
+	if (is_null($value))
5540 5540
 		return 'N;';
5541 5541
 
5542
-	if(is_bool($value))
5543
-		return 'b:'. (int) $value .';';
5542
+	if (is_bool($value))
5543
+		return 'b:' . (int) $value . ';';
5544 5544
 
5545
-	if(is_int($value))
5546
-		return 'i:'. $value .';';
5545
+	if (is_int($value))
5546
+		return 'i:' . $value . ';';
5547 5547
 
5548
-	if(is_float($value))
5549
-		return 'd:'. str_replace(',', '.', $value) .';';
5548
+	if (is_float($value))
5549
+		return 'd:' . str_replace(',', '.', $value) . ';';
5550 5550
 
5551
-	if(is_string($value))
5552
-		return 's:'. strlen($value) .':"'. $value .'";';
5551
+	if (is_string($value))
5552
+		return 's:' . strlen($value) . ':"' . $value . '";';
5553 5553
 
5554
-	if(is_array($value))
5554
+	if (is_array($value))
5555 5555
 	{
5556 5556
 		$out = '';
5557
-		foreach($value as $k => $v)
5557
+		foreach ($value as $k => $v)
5558 5558
 			$out .= _safe_serialize($k) . _safe_serialize($v);
5559 5559
 
5560
-		return 'a:'. count($value) .':{'. $out .'}';
5560
+		return 'a:' . count($value) . ':{' . $out . '}';
5561 5561
 	}
5562 5562
 
5563 5563
 	// safe_serialize cannot serialize resources or objects.
@@ -5599,7 +5599,7 @@  discard block
 block discarded – undo
5599 5599
 function _safe_unserialize($str)
5600 5600
 {
5601 5601
 	// Input  is not a string.
5602
-	if(empty($str) || !is_string($str))
5602
+	if (empty($str) || !is_string($str))
5603 5603
 		return false;
5604 5604
 
5605 5605
 	$stack = array();
@@ -5613,40 +5613,40 @@  discard block
 block discarded – undo
5613 5613
 	 *   3 - in array, expecting value or another array
5614 5614
 	 */
5615 5615
 	$state = 0;
5616
-	while($state != 1)
5616
+	while ($state != 1)
5617 5617
 	{
5618 5618
 		$type = isset($str[0]) ? $str[0] : '';
5619
-		if($type == '}')
5619
+		if ($type == '}')
5620 5620
 			$str = substr($str, 1);
5621 5621
 
5622
-		else if($type == 'N' && $str[1] == ';')
5622
+		else if ($type == 'N' && $str[1] == ';')
5623 5623
 		{
5624 5624
 			$value = null;
5625 5625
 			$str = substr($str, 2);
5626 5626
 		}
5627
-		else if($type == 'b' && preg_match('/^b:([01]);/', $str, $matches))
5627
+		else if ($type == 'b' && preg_match('/^b:([01]);/', $str, $matches))
5628 5628
 		{
5629 5629
 			$value = $matches[1] == '1' ? true : false;
5630 5630
 			$str = substr($str, 4);
5631 5631
 		}
5632
-		else if($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches))
5632
+		else if ($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches))
5633 5633
 		{
5634
-			$value = (int)$matches[1];
5634
+			$value = (int) $matches[1];
5635 5635
 			$str = $matches[2];
5636 5636
 		}
5637
-		else if($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches))
5637
+		else if ($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches))
5638 5638
 		{
5639
-			$value = (float)$matches[1];
5639
+			$value = (float) $matches[1];
5640 5640
 			$str = $matches[3];
5641 5641
 		}
5642
-		else if($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int)$matches[1], 2) == '";')
5642
+		else if ($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int) $matches[1], 2) == '";')
5643 5643
 		{
5644
-			$value = substr($matches[2], 0, (int)$matches[1]);
5645
-			$str = substr($matches[2], (int)$matches[1] + 2);
5644
+			$value = substr($matches[2], 0, (int) $matches[1]);
5645
+			$str = substr($matches[2], (int) $matches[1] + 2);
5646 5646
 		}
5647
-		else if($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches))
5647
+		else if ($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches))
5648 5648
 		{
5649
-			$expectedLength = (int)$matches[1];
5649
+			$expectedLength = (int) $matches[1];
5650 5650
 			$str = $matches[2];
5651 5651
 		}
5652 5652
 
@@ -5654,10 +5654,10 @@  discard block
 block discarded – undo
5654 5654
 		else
5655 5655
 			return false;
5656 5656
 
5657
-		switch($state)
5657
+		switch ($state)
5658 5658
 		{
5659 5659
 			case 3: // In array, expecting value or another array.
5660
-				if($type == 'a')
5660
+				if ($type == 'a')
5661 5661
 				{
5662 5662
 					$stack[] = &$list;
5663 5663
 					$list[$key] = array();
@@ -5666,7 +5666,7 @@  discard block
 block discarded – undo
5666 5666
 					$state = 2;
5667 5667
 					break;
5668 5668
 				}
5669
-				if($type != '}')
5669
+				if ($type != '}')
5670 5670
 				{
5671 5671
 					$list[$key] = $value;
5672 5672
 					$state = 2;
@@ -5677,29 +5677,29 @@  discard block
 block discarded – undo
5677 5677
 				return false;
5678 5678
 
5679 5679
 			case 2: // in array, expecting end of array or a key
5680
-				if($type == '}')
5680
+				if ($type == '}')
5681 5681
 				{
5682 5682
 					// Array size is less than expected.
5683
-					if(count($list) < end($expected))
5683
+					if (count($list) < end($expected))
5684 5684
 						return false;
5685 5685
 
5686 5686
 					unset($list);
5687
-					$list = &$stack[count($stack)-1];
5687
+					$list = &$stack[count($stack) - 1];
5688 5688
 					array_pop($stack);
5689 5689
 
5690 5690
 					// Go to terminal state if we're at the end of the root array.
5691 5691
 					array_pop($expected);
5692 5692
 
5693
-					if(count($expected) == 0)
5693
+					if (count($expected) == 0)
5694 5694
 						$state = 1;
5695 5695
 
5696 5696
 					break;
5697 5697
 				}
5698 5698
 
5699
-				if($type == 'i' || $type == 's')
5699
+				if ($type == 'i' || $type == 's')
5700 5700
 				{
5701 5701
 					// Array size exceeds expected length.
5702
-					if(count($list) >= end($expected))
5702
+					if (count($list) >= end($expected))
5703 5703
 						return false;
5704 5704
 
5705 5705
 					$key = $value;
@@ -5712,7 +5712,7 @@  discard block
 block discarded – undo
5712 5712
 
5713 5713
 			// Expecting array or value.
5714 5714
 			case 0:
5715
-				if($type == 'a')
5715
+				if ($type == 'a')
5716 5716
 				{
5717 5717
 					$data = array();
5718 5718
 					$list = &$data;
@@ -5721,7 +5721,7 @@  discard block
 block discarded – undo
5721 5721
 					break;
5722 5722
 				}
5723 5723
 
5724
-				if($type != '}')
5724
+				if ($type != '}')
5725 5725
 				{
5726 5726
 					$data = $value;
5727 5727
 					$state = 1;
@@ -5734,7 +5734,7 @@  discard block
 block discarded – undo
5734 5734
 	}
5735 5735
 
5736 5736
 	// Trailing data in input.
5737
-	if(!empty($str))
5737
+	if (!empty($str))
5738 5738
 		return false;
5739 5739
 
5740 5740
 	return $data;
@@ -5788,7 +5788,7 @@  discard block
 block discarded – undo
5788 5788
 	// Set different modes.
5789 5789
 	$chmodValues = $isDir ? array(0750, 0755, 0775, 0777) : array(0644, 0664, 0666);
5790 5790
 
5791
-	foreach($chmodValues as $val)
5791
+	foreach ($chmodValues as $val)
5792 5792
 	{
5793 5793
 		// If it's writable, break out of the loop.
5794 5794
 		if (is_writable($file))
@@ -5823,13 +5823,13 @@  discard block
 block discarded – undo
5823 5823
 	$returnArray = @json_decode($json, $returnAsArray);
5824 5824
 
5825 5825
 	// PHP 5.3 so no json_last_error_msg()
5826
-	switch(json_last_error())
5826
+	switch (json_last_error())
5827 5827
 	{
5828 5828
 		case JSON_ERROR_NONE:
5829 5829
 			$jsonError = false;
5830 5830
 			break;
5831 5831
 		case JSON_ERROR_DEPTH:
5832
-			$jsonError =  'JSON_ERROR_DEPTH';
5832
+			$jsonError = 'JSON_ERROR_DEPTH';
5833 5833
 			break;
5834 5834
 		case JSON_ERROR_STATE_MISMATCH:
5835 5835
 			$jsonError = 'JSON_ERROR_STATE_MISMATCH';
@@ -5857,10 +5857,10 @@  discard block
 block discarded – undo
5857 5857
 		loadLanguage('Errors');
5858 5858
 
5859 5859
 		if (!empty($jsonDebug))
5860
-			log_error($txt['json_'. $jsonError], 'critical', $jsonDebug['file'], $jsonDebug['line']);
5860
+			log_error($txt['json_' . $jsonError], 'critical', $jsonDebug['file'], $jsonDebug['line']);
5861 5861
 
5862 5862
 		else
5863
-			log_error($txt['json_'. $jsonError], 'critical');
5863
+			log_error($txt['json_' . $jsonError], 'critical');
5864 5864
 
5865 5865
 		// Everyone expects an array.
5866 5866
 		return array();
@@ -5977,7 +5977,7 @@  discard block
 block discarded – undo
5977 5977
 		// Convert Punycode to Unicode
5978 5978
 		require_once($sourcedir . '/Class-Punycode.php');
5979 5979
 		$Punycode = new Punycode();
5980
-		$tlds = array_map(function ($input) use ($Punycode) { return $Punycode->decode($input); }, $tlds);
5980
+		$tlds = array_map(function($input) use ($Punycode) { return $Punycode->decode($input); }, $tlds);
5981 5981
 	}
5982 5982
 	// Otherwise, use the 2012 list of gTLDs and ccTLDs for now and schedule a background update
5983 5983
 	else
@@ -6071,7 +6071,7 @@  discard block
 block discarded – undo
6071 6071
 	}
6072 6072
 
6073 6073
 	// This recursive function creates the index array from the strings
6074
-	$add_string_to_index = function ($string, $index) use (&$strlen, &$substr, &$add_string_to_index)
6074
+	$add_string_to_index = function($string, $index) use (&$strlen, &$substr, &$add_string_to_index)
6075 6075
 	{
6076 6076
 		static $depth = 0;
6077 6077
 		$depth++;
@@ -6098,7 +6098,7 @@  discard block
 block discarded – undo
6098 6098
 	};
6099 6099
 
6100 6100
 	// This recursive function turns the index array into a regular expression
6101
-	$index_to_regex = function (&$index, $delim) use (&$strlen, &$index_to_regex)
6101
+	$index_to_regex = function(&$index, $delim) use (&$strlen, &$index_to_regex)
6102 6102
 	{
6103 6103
 		static $depth = 0;
6104 6104
 		$depth++;
@@ -6122,11 +6122,11 @@  discard block
 block discarded – undo
6122 6122
 
6123 6123
 				if (count(array_keys($value)) == 1)
6124 6124
 				{
6125
-					$new_key_array = explode('(?'.'>', $sub_regex);
6125
+					$new_key_array = explode('(?' . '>', $sub_regex);
6126 6126
 					$new_key .= $new_key_array[0];
6127 6127
 				}
6128 6128
 				else
6129
-					$sub_regex = '(?'.'>' . $sub_regex . ')';
6129
+					$sub_regex = '(?' . '>' . $sub_regex . ')';
6130 6130
 			}
6131 6131
 
6132 6132
 			if ($depth > 1)
@@ -6169,10 +6169,10 @@  discard block
 block discarded – undo
6169 6169
 	{
6170 6170
 		$regex = array();
6171 6171
 		while (!empty($index))
6172
-			$regex[] = '(?'.'>' . $index_to_regex($index, $delim) . ')';
6172
+			$regex[] = '(?' . '>' . $index_to_regex($index, $delim) . ')';
6173 6173
 	}
6174 6174
 	else
6175
-		$regex = '(?'.'>' . $index_to_regex($index, $delim) . ')';
6175
+		$regex = '(?' . '>' . $index_to_regex($index, $delim) . ')';
6176 6176
 
6177 6177
 	// Restore PHP's internal character encoding to whatever it was originally
6178 6178
 	if (!empty($current_encoding))
@@ -6396,7 +6396,7 @@  discard block
 block discarded – undo
6396 6396
 function sanitize_iri($iri)
6397 6397
 {
6398 6398
 	// Encode any non-ASCII characters (but not space or control characters of any sort)
6399
-	$iri = preg_replace_callback('~[^\x00-\x7F\pZ\pC]~u', function ($matches) {
6399
+	$iri = preg_replace_callback('~[^\x00-\x7F\pZ\pC]~u', function($matches) {
6400 6400
 		return rawurlencode($matches[0]);
6401 6401
 	}, $iri);
6402 6402
 
@@ -6438,7 +6438,7 @@  discard block
 block discarded – undo
6438 6438
 	$unescaped = array(
6439 6439
 		'%21'=>'!', '%23'=>'#', '%24'=>'$', '%26'=>'&',
6440 6440
 		'%27'=>"'", '%28'=>'(', '%29'=>')', '%2A'=>'*',
6441
-		'%2B'=>'+', '%2C'=>',',	'%2F'=>'/', '%3A'=>':',
6441
+		'%2B'=>'+', '%2C'=>',', '%2F'=>'/', '%3A'=>':',
6442 6442
 		'%3B'=>';', '%3D'=>'=', '%3F'=>'?', '%40'=>'@',
6443 6443
 	);
6444 6444
 	$iri = strtr(rawurlencode($iri), $unescaped);
Please login to merge, or discard this patch.
Sources/Subs-BoardIndex.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
86 86
 	$smcFunc['db_free_result']($result_boards);
87 87
 
88 88
 	// Run through the categories and boards (or only boards)....
89
-	for (reset($row_boards); key($row_boards)!==null; next($row_boards))
89
+	for (reset($row_boards); key($row_boards) !== null; next($row_boards))
90 90
 	{
91 91
 		$row_board = current($row_boards);
92 92
 
Please login to merge, or discard this patch.
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();
@@ -997,7 +997,7 @@  discard block
 block discarded – undo
997 997
 		// Are the result fresh?
998 998
 		if (!$update_cache && !empty($_SESSION['search_cache']['id_search']))
999 999
 		{
1000
-			$request = $smcFunc['db_query']('','
1000
+			$request = $smcFunc['db_query']('', '
1001 1001
 				SELECT id_search 
1002 1002
 				FROM {db_prefix}log_search_results
1003 1003
 				WHERE id_search = {int:search_id}
@@ -1119,7 +1119,7 @@  discard block
 block discarded – undo
1119 1119
 						SELECT
1120 1120
 							{int:id_search},
1121 1121
 							t.id_topic,
1122
-							' . $relevance. ',
1122
+							' . $relevance . ',
1123 1123
 							' . (empty($userQuery) ? 't.id_first_msg' : 'm.id_msg') . ',
1124 1124
 							1
1125 1125
 						FROM ' . $subject_query['from'] . (empty($subject_query['inner_join']) ? '' : '
@@ -1352,7 +1352,7 @@  discard block
 block discarded – undo
1352 1352
 						if (empty($subject_query['where']))
1353 1353
 							continue;
1354 1354
 
1355
-						$ignoreRequest = $smcFunc['db_search_query']('insert_log_search_topics', ($smcFunc['db_support_ignore'] ? ( '
1355
+						$ignoreRequest = $smcFunc['db_search_query']('insert_log_search_topics', ($smcFunc['db_support_ignore'] ? ('
1356 1356
 							INSERT IGNORE INTO {db_prefix}' . ($createTemporary ? 'tmp_' : '') . 'log_search_topics
1357 1357
 								(' . ($createTemporary ? '' : 'id_search, ') . 'id_topic)') : '') . '
1358 1358
 							SELECT ' . ($createTemporary ? '' : $_SESSION['search_cache']['id_search'] . ', ') . 't.id_topic
@@ -1579,7 +1579,7 @@  discard block
 block discarded – undo
1579 1579
 					}
1580 1580
 					$main_query['select']['relevance'] = substr($relevance, 0, -3) . ') / ' . $new_weight_total . ' AS relevance';
1581 1581
 
1582
-					$ignoreRequest = $smcFunc['db_search_query']('insert_log_search_results_no_index', ($smcFunc['db_support_ignore'] ? ( '
1582
+					$ignoreRequest = $smcFunc['db_search_query']('insert_log_search_results_no_index', ($smcFunc['db_support_ignore'] ? ('
1583 1583
 						INSERT IGNORE INTO ' . '{db_prefix}log_search_results
1584 1584
 							(' . implode(', ', array_keys($main_query['select'])) . ')') : '') . '
1585 1585
 						SELECT
@@ -1647,7 +1647,7 @@  discard block
 block discarded – undo
1647 1647
 					$relevance = substr($relevance, 0, -3) . ') / ' . $weight_total . ' AS relevance';
1648 1648
 
1649 1649
 					$usedIDs = array_flip(empty($inserts) ? array() : array_keys($inserts));
1650
-					$ignoreRequest = $smcFunc['db_search_query']('insert_log_search_results_sub_only', ($smcFunc['db_support_ignore'] ? ( '
1650
+					$ignoreRequest = $smcFunc['db_search_query']('insert_log_search_results_sub_only', ($smcFunc['db_support_ignore'] ? ('
1651 1651
 						INSERT IGNORE INTO {db_prefix}log_search_results
1652 1652
 							(id_search, id_topic, relevance, id_msg, num_matches)') : '') . '
1653 1653
 						SELECT
@@ -2116,7 +2116,7 @@  discard block
 block discarded – undo
2116 2116
 		if (strlen($query) == 0)
2117 2117
 			continue;
2118 2118
 
2119
-		$body_highlighted = preg_replace_callback('/((<[^>]*)|' . preg_quote(strtr($query, array('\'' => '&#039;')), '/') . ')/i' . ($context['utf8'] ? 'u' : ''), function ($m)
2119
+		$body_highlighted = preg_replace_callback('/((<[^>]*)|' . preg_quote(strtr($query, array('\'' => '&#039;')), '/') . ')/i' . ($context['utf8'] ? 'u' : ''), function($m)
2120 2120
 		{
2121 2121
 			return isset($m[2]) && "$m[2]" == "$m[1]" ? stripslashes("$m[1]") : "<strong class=\"highlight\">$m[1]</strong>";
2122 2122
 		}, $body_highlighted);
Please login to merge, or discard this patch.
Sources/Errors.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 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.');
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
 		$url['error'] = $error;
550 550
 		// Url field got a max length of 1024 in db
551 551
 		if (strlen($url['error']) > 500)
552
-			$url['error'] = substr($url['error'],0,500);
552
+			$url['error'] = substr($url['error'], 0, 500);
553 553
 
554 554
 		if (!empty($sprintf))
555 555
 			$url['error_params'] = $sprintf;
Please login to merge, or discard this patch.
Themes/default/Memberlist.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@
 block discarded – undo
106 106
 			if (!empty($context['custom_profile_fields']['columns']))
107 107
 				foreach ($context['custom_profile_fields']['columns'] as $key => $column)
108 108
 					echo '
109
-						<td class="' , $key , ' centertext">', $member['options'][$key], '</td>';
109
+						<td class="' , $key, ' centertext">', $member['options'][$key], '</td>';
110 110
 
111 111
 			echo '
112 112
 					</tr>';
Please login to merge, or discard this patch.
Sources/ManageBans.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -283,11 +283,11 @@  discard block
 block discarded – undo
283 283
 			if (removeItems == 0)
284 284
 			{
285 285
 				e.preventDefault();
286
-				return alert("'. $txt['select_item_check'] .'");
286
+				return alert("'. $txt['select_item_check'] . '");
287 287
 			}
288 288
 
289 289
 
290
-			return confirm("'. $txt['ban_remove_selected_confirm'] .'");
290
+			return confirm("'. $txt['ban_remove_selected_confirm'] . '");
291 291
 		});',
292 292
 	);
293 293
 
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
 					array(
487 487
 						'position' => 'below_table_data',
488 488
 						'value' => '
489
-						<input type="submit" name="remove_selection" value="' . $txt['ban_remove_selected_triggers'] . '" class="button"> <a class="button" href="' . $scripturl	. '?action=admin;area=ban;sa=edittrigger;bg=' . $ban_group_id . '">' . $txt['ban_add_trigger'] . '</a>',
489
+						<input type="submit" name="remove_selection" value="' . $txt['ban_remove_selected_triggers'] . '" class="button"> <a class="button" href="' . $scripturl . '?action=admin;area=ban;sa=edittrigger;bg=' . $ban_group_id . '">' . $txt['ban_add_trigger'] . '</a>',
490 490
 						'style' => 'text-align: right;',
491 491
 					),
492 492
 					array(
@@ -506,11 +506,11 @@  discard block
 block discarded – undo
506 506
 			if (removeItems == 0)
507 507
 			{
508 508
 				e.preventDefault();
509
-				return alert("'. $txt['select_item_check'] .'");
509
+				return alert("'. $txt['select_item_check'] . '");
510 510
 			}
511 511
 
512 512
 
513
-			return confirm("'. $txt['ban_remove_selected_confirm'] .'");
513
+			return confirm("'. $txt['ban_remove_selected_confirm'] . '");
514 514
 		});',
515 515
 			);
516 516
 			createList($listOptions);
Please login to merge, or discard this patch.
Themes/default/Errors.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -328,7 +328,7 @@
 block discarded – undo
328 328
 		foreach ($context['error_info']['backtrace'] as $key => $value)
329 329
 		{
330 330
 			//Check for existing
331
-			if (!property_exists($value,'file') || empty($value->file))
331
+			if (!property_exists($value, 'file') || empty($value->file))
332 332
 				$value->file = $txt['unknown'];
333 333
 			if (!property_exists($value, 'line') || empty($value->line))
334 334
 				$value->line = -1;
Please login to merge, or discard this patch.