Passed
Pull Request — release-2.1 (#7165)
by John
06:10
created
Sources/Register.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -315,7 +315,7 @@
 block discarded – undo
315 315
 
316 316
 	array_walk_recursive(
317 317
 		$_POST,
318
-		function (&$value, $key) use ($context, $smcFunc)
318
+		function(&$value, $key) use ($context, $smcFunc)
319 319
 		{
320 320
 			// Normalize Unicode characters. (Does nothing if not in UTF-8 mode.)
321 321
 			$value = $smcFunc['normalize']($value);
Please login to merge, or discard this patch.
Sources/ManageMaintenance.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2060,7 +2060,7 @@
 block discarded – undo
2060 2060
 		new RecursiveIteratorIterator(
2061 2061
 			new RecursiveCallbackFilterIterator(
2062 2062
 				new RecursiveDirectoryIterator($dirname, FilesystemIterator::UNIX_PATHS),
2063
-				function ($fileInfo, $currentFile, $iterator)
2063
+				function($fileInfo, $currentFile, $iterator)
2064 2064
 				{
2065 2065
 					// Allow recursion
2066 2066
 					if ($iterator->hasChildren())
Please login to merge, or discard this patch.
Sources/Subs.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
 			{
379 379
 				$val = 'CASE ';
380 380
 				foreach ($members as $k => $v)
381
-					$val .= 'WHEN id_member = ' . $v . ' THEN '. alert_count($v, true) . ' ';
381
+					$val .= 'WHEN id_member = ' . $v . ' THEN ' . alert_count($v, true) . ' ';
382 382
 
383 383
 				$val = $val . ' END';
384 384
 				$type = 'raw';
@@ -1045,11 +1045,11 @@  discard block
 block discarded – undo
1045 1045
 			// Anything that isn't a specification, punctuation mark, or whitespace.
1046 1046
 			'~(?<!%)\p{L}|[^\p{L}\p{P}\s]~u',
1047 1047
 			// A series of punctuation marks (except %), possibly separated by whitespace.
1048
-			'~([^%\P{P}])(\s*)(?'.'>(\1|[^%\P{Po}])\s*(?!$))*~u',
1048
+			'~([^%\P{P}])(\s*)(?' . '>(\1|[^%\P{Po}])\s*(?!$))*~u',
1049 1049
 			// Unwanted trailing punctuation and whitespace.
1050
-			'~(?'.'>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u',
1050
+			'~(?' . '>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u',
1051 1051
 			// Unwanted opening punctuation and whitespace.
1052
-			'~^\s*(?'.'>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u',
1052
+			'~^\s*(?' . '>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u',
1053 1053
 		),
1054 1054
 		array(
1055 1055
 			'',
@@ -1139,7 +1139,7 @@  discard block
 block discarded – undo
1139 1139
 	elseif (!empty($context['character_set']) && is_callable('mb_decode_numericentity'))
1140 1140
 	{
1141 1141
 		// Get whatever the default replacement character is for this encoding.
1142
-		$substitute = mb_decode_numericentity('&#xFFFD;', array(0xFFFD,0xFFFD,0,0xFFFF), $context['character_set']);
1142
+		$substitute = mb_decode_numericentity('&#xFFFD;', array(0xFFFD, 0xFFFD, 0, 0xFFFF), $context['character_set']);
1143 1143
 	}
1144 1144
 	else
1145 1145
 		$substitute = '?';
@@ -1624,7 +1624,7 @@  discard block
 block discarded – undo
1624 1624
 								$returnContext .= '<img src="' . $currentAttachment['href'] . '"' . $alt . $title . ' class="bbc_img">';
1625 1625
 							else
1626 1626
 							{
1627
-								$width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"': '';
1627
+								$width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"' : '';
1628 1628
 								$height = !empty($params['{height}']) ? 'height="' . $params['{height}'] . '"' : '';
1629 1629
 								$returnContext .= '<img src="' . $currentAttachment['href'] . ';image"' . $alt . $title . $width . $height . ' class="bbc_img resized"/>';
1630 1630
 							}
@@ -1635,7 +1635,7 @@  discard block
 block discarded – undo
1635 1635
 							$width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"' : '';
1636 1636
 							$height = !empty($params['{height}']) ? ' height="' . $params['{height}'] . '"' : '';
1637 1637
 
1638
-							$returnContext .= '<div class="videocontainer"><video controls preload="metadata" src="'. $currentAttachment['href'] . '" playsinline' . $width . $height . '><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></video></div>' . (!empty($data) && $data != $currentAttachment['name'] ? '<div class="smalltext">' . $data . '</div>' : '');
1638
+							$returnContext .= '<div class="videocontainer"><video controls preload="metadata" src="' . $currentAttachment['href'] . '" playsinline' . $width . $height . '><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></video></div>' . (!empty($data) && $data != $currentAttachment['name'] ? '<div class="smalltext">' . $data . '</div>' : '');
1639 1639
 						}
1640 1640
 						// Audio.
1641 1641
 						elseif (strpos($currentAttachment['mime_type'], 'audio/') === 0)
@@ -1643,7 +1643,7 @@  discard block
 block discarded – undo
1643 1643
 							$width = 'max-width:100%; width: ' . (!empty($params['{width}']) ? $params['{width}'] : '400') . 'px;';
1644 1644
 							$height = !empty($params['{height}']) ? 'height: ' . $params['{height}'] . 'px;' : '';
1645 1645
 
1646
-							$returnContext .= (!empty($data) && $data != $currentAttachment['name'] ? $data . ' ' : '') . '<audio controls preload="none" src="'. $currentAttachment['href'] . '" class="bbc_audio" style="vertical-align:middle;' . $width . $height . '"><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></audio>';
1646
+							$returnContext .= (!empty($data) && $data != $currentAttachment['name'] ? $data . ' ' : '') . '<audio controls preload="none" src="' . $currentAttachment['href'] . '" class="bbc_audio" style="vertical-align:middle;' . $width . $height . '"><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></audio>';
1647 1647
 						}
1648 1648
 						// Anything else.
1649 1649
 						else
@@ -1812,7 +1812,7 @@  discard block
 block discarded – undo
1812 1812
 				'type' => 'unparsed_commas_content',
1813 1813
 				'test' => '\d+,\d+\]',
1814 1814
 				'content' => '<a href="$1" target="_blank" rel="noopener">$1</a>',
1815
-				'validate' => function (&$tag, &$data, $disabled)
1815
+				'validate' => function(&$tag, &$data, $disabled)
1816 1816
 				{
1817 1817
 					$data[0] = normalize_iri($data[0]);
1818 1818
 
@@ -1938,8 +1938,8 @@  discard block
 block discarded – undo
1938 1938
 					else
1939 1939
 						$url = get_proxied_url($url);
1940 1940
 
1941
-					$alt = !empty($params['{alt}']) ? ' alt="' . $params['{alt}']. '"' : ' alt=""';
1942
-					$title = !empty($params['{title}']) ? ' title="' . $params['{title}']. '"' : '';
1941
+					$alt = !empty($params['{alt}']) ? ' alt="' . $params['{alt}'] . '"' : ' alt=""';
1942
+					$title = !empty($params['{title}']) ? ' title="' . $params['{title}'] . '"' : '';
1943 1943
 
1944 1944
 					$data = isset($disabled[$tag['tag']]) ? $url : '<img src="' . $url . '"' . $alt . $title . $params['{width}'] . $params['{height}'] . ' class="bbc_img' . (!empty($params['{width}']) || !empty($params['{height}']) ? ' resized' : '') . '" loading="lazy">';
1945 1945
 				},
@@ -2370,12 +2370,12 @@  discard block
 block discarded – undo
2370 2370
 		$codes[] = array(
2371 2371
 			'tag' => 'cowsay',
2372 2372
 			'parameters' => array(
2373
-				'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc)
2373
+				'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function($eyes) use ($smcFunc)
2374 2374
 					{
2375 2375
 						return $smcFunc['substr']($eyes . 'oo', 0, 2);
2376 2376
 					},
2377 2377
 				),
2378
-				't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => '  ', 'validate' => function ($tongue) use ($smcFunc)
2378
+				't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => '  ', 'validate' => function($tongue) use ($smcFunc)
2379 2379
 					{
2380 2380
 						return $smcFunc['substr']($tongue . '  ', 0, 2);
2381 2381
 					},
@@ -4080,7 +4080,7 @@  discard block
 block discarded – undo
4080 4080
 		if ($fp != false)
4081 4081
 		{
4082 4082
 			// Send the HEAD request (since we don't have to worry about chunked, HTTP/1.1 is fine here.)
4083
-			fwrite($fp, 'HEAD /' . $match[2] . ' HTTP/1.1' . "\r\n" . 'Host: ' . $match[1] . "\r\n" . 'user-agent: '. SMF_USER_AGENT . "\r\n" . 'Connection: close' . "\r\n\r\n");
4083
+			fwrite($fp, 'HEAD /' . $match[2] . ' HTTP/1.1' . "\r\n" . 'Host: ' . $match[1] . "\r\n" . 'user-agent: ' . SMF_USER_AGENT . "\r\n" . 'Connection: close' . "\r\n\r\n");
4084 4084
 
4085 4085
 			// Read in the HTTP/1.1 or whatever.
4086 4086
 			$test = substr(fgets($fp, 11), -1);
@@ -4676,7 +4676,7 @@  discard block
 block discarded – undo
4676 4676
 
4677 4677
 	uasort(
4678 4678
 		$context['css_files'],
4679
-		function ($a, $b)
4679
+		function($a, $b)
4680 4680
 		{
4681 4681
 			return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0);
4682 4682
 		}
@@ -5973,7 +5973,7 @@  discard block
 block discarded – undo
5973 5973
 			{
5974 5974
 				fwrite($fp, 'GET ' . ($match[6] !== '/' ? str_replace(' ', '%20', $match[6]) : '') . ' HTTP/1.0' . "\r\n");
5975 5975
 				fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n");
5976
-				fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n");
5976
+				fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n");
5977 5977
 				if ($keep_alive)
5978 5978
 					fwrite($fp, 'connection: Keep-Alive' . "\r\n\r\n");
5979 5979
 				else
@@ -5983,7 +5983,7 @@  discard block
 block discarded – undo
5983 5983
 			{
5984 5984
 				fwrite($fp, 'POST ' . ($match[6] !== '/' ? $match[6] : '') . ' HTTP/1.0' . "\r\n");
5985 5985
 				fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n");
5986
-				fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n");
5986
+				fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n");
5987 5987
 				if ($keep_alive)
5988 5988
 					fwrite($fp, 'connection: Keep-Alive' . "\r\n");
5989 5989
 				else
@@ -6232,13 +6232,13 @@  discard block
 block discarded – undo
6232 6232
 
6233 6233
 	// UTF-8 occurences of MS special characters
6234 6234
 	$findchars_utf8 = array(
6235
-		"\xe2\x80\x9a",	// single low-9 quotation mark
6236
-		"\xe2\x80\x9e",	// double low-9 quotation mark
6237
-		"\xe2\x80\xa6",	// horizontal ellipsis
6238
-		"\xe2\x80\x98",	// left single curly quote
6239
-		"\xe2\x80\x99",	// right single curly quote
6240
-		"\xe2\x80\x9c",	// left double curly quote
6241
-		"\xe2\x80\x9d",	// right double curly quote
6235
+		"\xe2\x80\x9a", // single low-9 quotation mark
6236
+		"\xe2\x80\x9e", // double low-9 quotation mark
6237
+		"\xe2\x80\xa6", // horizontal ellipsis
6238
+		"\xe2\x80\x98", // left single curly quote
6239
+		"\xe2\x80\x99", // right single curly quote
6240
+		"\xe2\x80\x9c", // left double curly quote
6241
+		"\xe2\x80\x9d", // right double curly quote
6242 6242
 	);
6243 6243
 
6244 6244
 	// windows 1252 / iso equivalents
@@ -6254,13 +6254,13 @@  discard block
 block discarded – undo
6254 6254
 
6255 6255
 	// safe replacements
6256 6256
 	$replacechars = array(
6257
-		',',	// &sbquo;
6258
-		',,',	// &bdquo;
6259
-		'...',	// &hellip;
6260
-		"'",	// &lsquo;
6261
-		"'",	// &rsquo;
6262
-		'"',	// &ldquo;
6263
-		'"',	// &rdquo;
6257
+		',', // &sbquo;
6258
+		',,', // &bdquo;
6259
+		'...', // &hellip;
6260
+		"'", // &lsquo;
6261
+		"'", // &rsquo;
6262
+		'"', // &ldquo;
6263
+		'"', // &rdquo;
6264 6264
 	);
6265 6265
 
6266 6266
 	if ($context['utf8'])
@@ -6621,7 +6621,7 @@  discard block
 block discarded – undo
6621 6621
 		// We don't want abbreviations like '+03' or '-11'.
6622 6622
 		$abbrs = array_filter(
6623 6623
 			$tzvalue['abbrs'],
6624
-			function ($abbr)
6624
+			function($abbr)
6625 6625
 			{
6626 6626
 				return !strspn($abbr, '+-');
6627 6627
 			}
@@ -7610,7 +7610,7 @@  discard block
 block discarded – undo
7610 7610
 			EXISTS (
7611 7611
 				SELECT bpv.id_board
7612 7612
 				FROM ' . $db_prefix . 'board_permissions_view AS bpv
7613
-				WHERE bpv.id_group IN ('. implode(',', $groups) .')
7613
+				WHERE bpv.id_group IN ('. implode(',', $groups) . ')
7614 7614
 					AND bpv.deny = 0
7615 7615
 					AND bpv.id_board = b.id_board
7616 7616
 			)';
@@ -7620,7 +7620,7 @@  discard block
 block discarded – undo
7620 7620
 			AND NOT EXISTS (
7621 7621
 				SELECT bpv.id_board
7622 7622
 				FROM ' . $db_prefix . 'board_permissions_view AS bpv
7623
-				WHERE bpv.id_group IN ( '. implode(',', $groups) .')
7623
+				WHERE bpv.id_group IN ( '. implode(',', $groups) . ')
7624 7624
 					AND bpv.deny = 1
7625 7625
 					AND bpv.id_board = b.id_board
7626 7626
 			)';
@@ -8027,8 +8027,8 @@  discard block
 block discarded – undo
8027 8027
 	$i = 0;
8028 8028
 	while (empty($done))
8029 8029
 	{
8030
-		if (strpos($format, '{'. --$i . '}') !== false)
8031
-			$replacements['{'. $i . '}'] = array_pop($list);
8030
+		if (strpos($format, '{' . --$i . '}') !== false)
8031
+			$replacements['{' . $i . '}'] = array_pop($list);
8032 8032
 		else
8033 8033
 			$done = true;
8034 8034
 	}
@@ -8038,8 +8038,8 @@  discard block
 block discarded – undo
8038 8038
 	$i = 0;
8039 8039
 	while (empty($done))
8040 8040
 	{
8041
-		if (strpos($format, '{'. ++$i . '}') !== false)
8042
-			$replacements['{'. $i . '}'] = array_shift($list);
8041
+		if (strpos($format, '{' . ++$i . '}') !== false)
8042
+			$replacements['{' . $i . '}'] = array_shift($list);
8043 8043
 		else
8044 8044
 			$done = true;
8045 8045
 	}
@@ -8217,7 +8217,7 @@  discard block
 block discarded – undo
8217 8217
 	if (empty($stringSubject))
8218 8218
 		return '';
8219 8219
 
8220
-	$translatable_tokens = preg_match_all('/{(.*?)}/' , $stringSubject, $matches);
8220
+	$translatable_tokens = preg_match_all('/{(.*?)}/', $stringSubject, $matches);
8221 8221
 	$toFind = array();
8222 8222
 	$replaceWith = array();
8223 8223
 
Please login to merge, or discard this patch.
Sources/Subs-Charset.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 	$combining_classes = utf8_combining_classes();
250 250
 
251 251
 	// Replace characters with decomposed forms.
252
-	for ($i=0; $i < count($chars); $i++)
252
+	for ($i = 0; $i < count($chars); $i++)
253 253
 	{
254 254
 		// Hangul characters.
255 255
 		if ($chars[$i] >= "\xEA\xB0\x80" && $chars[$i] <= "\xED\x9E\xA3")
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 		{
284 284
 			$temp = $chars[$i];
285 285
 			$chars[$i] = $chars[$i - 1];
286
-			$chars[$i -1] = $temp;
286
+			$chars[$i - 1] = $temp;
287 287
 
288 288
 			// Backtrack and check again.
289 289
 			if ($i > 1)
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
 
528 528
 	// Use placeholders to preserve known emoji from further processing.
529 529
 	// Regex source is https://unicode.org/reports/tr51/#EBNF_and_Regex
530
-	$string  = preg_replace_callback(
530
+	$string = preg_replace_callback(
531 531
 		'/' .
532 532
 		// Flag emojis
533 533
 		'[' . $prop_classes['Regional_Indicator'] . ']{2}' .
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
 			')?' .
557 557
 		')*' .
558 558
 		'/u',
559
-		function ($matches) use (&$placeholders)
559
+		function($matches) use (&$placeholders)
560 560
 		{
561 561
 			// Skip lone ASCII characters that are not actully part of an emoji sequence.
562 562
 			// This can happen because the digits 0-9 and the '*' and '#' characters are
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 		// Use placeholders for sanctioned variation selectors.
588 588
 		$string = preg_replace_callback(
589 589
 			$patterns,
590
-			function ($matches) use (&$placeholders)
590
+			function($matches) use (&$placeholders)
591 591
 			{
592 592
 				$placeholders[$matches[0]] = "\xEE\xB3\x9B" . md5($matches[0]) . "\xEE\xB3\x9C";
593 593
 				return $placeholders[$matches[0]];
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
 			// Do the thing.
668 668
 			$string = preg_replace_callback(
669 669
 				'/' . $pattern . '/u',
670
-				function ($matches) use ($placeholders)
670
+				function($matches) use ($placeholders)
671 671
 				{
672 672
 					return strtr($matches[0], $placeholders);
673 673
 				},
Please login to merge, or discard this patch.
other/update_unicode_data.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -752,7 +752,7 @@  discard block
 block discarded – undo
752 752
 	}
753 753
 }
754 754
 // This sort works decently well to ensure widely used scripts are ranked before rare scripts.
755
-uasort($funcs['utf8_regex_joining_type']['data'], function ($a, $b)
755
+uasort($funcs['utf8_regex_joining_type']['data'], function($a, $b)
756 756
 {
757 757
 	if ($a['stats']['age'] == $b['stats']['age'])
758 758
 	{
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
 	}
829 829
 }
830 830
 // Again, sort commonly used scripts before rare scripts.
831
-uasort($funcs['utf8_regex_indic']['data'], function ($a, $b)
831
+uasort($funcs['utf8_regex_indic']['data'], function($a, $b)
832 832
 {
833 833
 	if ($a['stats']['age'] == $b['stats']['age'])
834 834
 	{
Please login to merge, or discard this patch.