Passed
Pull Request — release-2.1 (#6185)
by Mathias
04:10
created
Sources/Subs.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 			{
378 378
 				$val = 'CASE ';
379 379
 				foreach ($members as $k => $v)
380
-					$val .= 'WHEN id_member = ' . $v . ' THEN '. alert_count($v, true) . ' ';
380
+					$val .= 'WHEN id_member = ' . $v . ' THEN ' . alert_count($v, true) . ' ';
381 381
 
382 382
 				$val = $val . ' END';
383 383
 				$type = 'raw';
@@ -1041,11 +1041,11 @@  discard block
 block discarded – undo
1041 1041
 			// Anything that isn't a specification, punctuation mark, or whitespace.
1042 1042
 			'~(?<!%)\p{L}|[^\p{L}\p{P}\s]~u',
1043 1043
 			// A series of punctuation marks (except %), possibly separated by whitespace.
1044
-			'~([^%\P{P}])(\s*)(?'.'>(\1|[^%\P{Po}])\s*(?!$))*~u',
1044
+			'~([^%\P{P}])(\s*)(?' . '>(\1|[^%\P{Po}])\s*(?!$))*~u',
1045 1045
 			// Unwanted trailing punctuation and whitespace.
1046
-			'~(?'.'>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u',
1046
+			'~(?' . '>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u',
1047 1047
 			// Unwanted opening punctuation and whitespace.
1048
-			'~^\s*(?'.'>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u',
1048
+			'~^\s*(?' . '>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u',
1049 1049
 		),
1050 1050
 		array(
1051 1051
 			'',
@@ -1460,7 +1460,7 @@  discard block
 block discarded – undo
1460 1460
 							$width = !empty($width) ? ' width="' . $width . '"' : '';
1461 1461
 							$height = !empty($height) ? ' height="' . $height . '"' : '';
1462 1462
 
1463
-							$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>' : '');
1463
+							$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>' : '');
1464 1464
 						}
1465 1465
 						// Audio.
1466 1466
 						elseif (strpos($currentAttachment['mime_type'], 'audio/') === 0)
@@ -1468,7 +1468,7 @@  discard block
 block discarded – undo
1468 1468
 							$width = 'max-width:100%; width: ' . (!empty($width) ? $width : '400') . 'px;';
1469 1469
 							$height = !empty($height) ? 'height: ' . $height . 'px;' : '';
1470 1470
 
1471
-							$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>';
1471
+							$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>';
1472 1472
 						}
1473 1473
 						// Anything else.
1474 1474
 						else
@@ -1637,7 +1637,7 @@  discard block
 block discarded – undo
1637 1637
 				'type' => 'unparsed_commas_content',
1638 1638
 				'test' => '\d+,\d+\]',
1639 1639
 				'content' => '<a href="$1" target="_blank" rel="noopener">$1</a>',
1640
-				'validate' => function (&$tag, &$data, $disabled)
1640
+				'validate' => function(&$tag, &$data, $disabled)
1641 1641
 				{
1642 1642
 					$scheme = parse_url($data[0], PHP_URL_SCHEME);
1643 1643
 					if (empty($scheme))
@@ -2175,12 +2175,12 @@  discard block
 block discarded – undo
2175 2175
 		$codes[] = array(
2176 2176
 			'tag' => 'cowsay',
2177 2177
 			'parameters' => array(
2178
-				'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc)
2178
+				'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function($eyes) use ($smcFunc)
2179 2179
 					{
2180 2180
 						return $smcFunc['substr']($eyes . 'oo', 0, 2);
2181 2181
 					},
2182 2182
 				),
2183
-				't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => '  ', 'validate' => function ($tongue) use ($smcFunc)
2183
+				't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => '  ', 'validate' => function($tongue) use ($smcFunc)
2184 2184
 					{
2185 2185
 						return $smcFunc['substr']($tongue . '  ', 0, 2);
2186 2186
 					},
@@ -3552,7 +3552,7 @@  discard block
 block discarded – undo
3552 3552
 		if ($fp != false)
3553 3553
 		{
3554 3554
 			// Send the HEAD request (since we don't have to worry about chunked, HTTP/1.1 is fine here.)
3555
-			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");
3555
+			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");
3556 3556
 
3557 3557
 			// Read in the HTTP/1.1 or whatever.
3558 3558
 			$test = substr(fgets($fp, 11), -1);
@@ -4156,7 +4156,7 @@  discard block
 block discarded – undo
4156 4156
 	$toMinify = array();
4157 4157
 	$normal = array();
4158 4158
 
4159
-	uasort($context['css_files'], function ($a, $b)
4159
+	uasort($context['css_files'], function($a, $b)
4160 4160
 	{
4161 4161
 		return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0);
4162 4162
 	});
@@ -5452,7 +5452,7 @@  discard block
 block discarded – undo
5452 5452
 			{
5453 5453
 				fwrite($fp, 'GET ' . ($match[6] !== '/' ? str_replace(' ', '%20', $match[6]) : '') . ' HTTP/1.0' . "\r\n");
5454 5454
 				fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n");
5455
-				fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n");
5455
+				fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n");
5456 5456
 				if ($keep_alive)
5457 5457
 					fwrite($fp, 'connection: Keep-Alive' . "\r\n\r\n");
5458 5458
 				else
@@ -5462,7 +5462,7 @@  discard block
 block discarded – undo
5462 5462
 			{
5463 5463
 				fwrite($fp, 'POST ' . ($match[6] !== '/' ? $match[6] : '') . ' HTTP/1.0' . "\r\n");
5464 5464
 				fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n");
5465
-				fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n");
5465
+				fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n");
5466 5466
 				if ($keep_alive)
5467 5467
 					fwrite($fp, 'connection: Keep-Alive' . "\r\n");
5468 5468
 				else
@@ -5710,13 +5710,13 @@  discard block
 block discarded – undo
5710 5710
 
5711 5711
 	// UTF-8 occurences of MS special characters
5712 5712
 	$findchars_utf8 = array(
5713
-		"\xe2\x80\x9a",	// single low-9 quotation mark
5714
-		"\xe2\x80\x9e",	// double low-9 quotation mark
5715
-		"\xe2\x80\xa6",	// horizontal ellipsis
5716
-		"\xe2\x80\x98",	// left single curly quote
5717
-		"\xe2\x80\x99",	// right single curly quote
5718
-		"\xe2\x80\x9c",	// left double curly quote
5719
-		"\xe2\x80\x9d",	// right double curly quote
5713
+		"\xe2\x80\x9a", // single low-9 quotation mark
5714
+		"\xe2\x80\x9e", // double low-9 quotation mark
5715
+		"\xe2\x80\xa6", // horizontal ellipsis
5716
+		"\xe2\x80\x98", // left single curly quote
5717
+		"\xe2\x80\x99", // right single curly quote
5718
+		"\xe2\x80\x9c", // left double curly quote
5719
+		"\xe2\x80\x9d", // right double curly quote
5720 5720
 	);
5721 5721
 
5722 5722
 	// windows 1252 / iso equivalents
@@ -5732,13 +5732,13 @@  discard block
 block discarded – undo
5732 5732
 
5733 5733
 	// safe replacements
5734 5734
 	$replacechars = array(
5735
-		',',	// &sbquo;
5736
-		',,',	// &bdquo;
5737
-		'...',	// &hellip;
5738
-		"'",	// &lsquo;
5739
-		"'",	// &rsquo;
5740
-		'"',	// &ldquo;
5741
-		'"',	// &rdquo;
5735
+		',', // &sbquo;
5736
+		',,', // &bdquo;
5737
+		'...', // &hellip;
5738
+		"'", // &lsquo;
5739
+		"'", // &rsquo;
5740
+		'"', // &ldquo;
5741
+		'"', // &rdquo;
5742 5742
 	);
5743 5743
 
5744 5744
 	if ($context['utf8'])
@@ -6923,7 +6923,7 @@  discard block
 block discarded – undo
6923 6923
 			EXISTS (
6924 6924
 				SELECT bpv.id_board
6925 6925
 				FROM ' . $db_prefix . 'board_permissions_view AS bpv
6926
-				WHERE bpv.id_group IN ('. implode(',', $groups) .')
6926
+				WHERE bpv.id_group IN ('. implode(',', $groups) . ')
6927 6927
 					AND bpv.deny = 0
6928 6928
 					AND bpv.id_board = b.id_board
6929 6929
 			)';
@@ -6933,7 +6933,7 @@  discard block
 block discarded – undo
6933 6933
 			AND NOT EXISTS (
6934 6934
 				SELECT bpv.id_board
6935 6935
 				FROM ' . $db_prefix . 'board_permissions_view AS bpv
6936
-				WHERE bpv.id_group IN ( '. implode(',', $groups) .')
6936
+				WHERE bpv.id_group IN ( '. implode(',', $groups) . ')
6937 6937
 					AND bpv.deny = 1
6938 6938
 					AND bpv.id_board = b.id_board
6939 6939
 			)';
@@ -7204,8 +7204,8 @@  discard block
 block discarded – undo
7204 7204
 	$i = 0;
7205 7205
 	while (empty($done))
7206 7206
 	{
7207
-		if (strpos($format, '{'. --$i . '}') !== false)
7208
-			$replacements['{'. $i . '}'] = array_pop($list);
7207
+		if (strpos($format, '{' . --$i . '}') !== false)
7208
+			$replacements['{' . $i . '}'] = array_pop($list);
7209 7209
 		else
7210 7210
 			$done = true;
7211 7211
 	}
@@ -7215,8 +7215,8 @@  discard block
 block discarded – undo
7215 7215
 	$i = 0;
7216 7216
 	while (empty($done))
7217 7217
 	{
7218
-		if (strpos($format, '{'. ++$i . '}') !== false)
7219
-			$replacements['{'. $i . '}'] = array_shift($list);
7218
+		if (strpos($format, '{' . ++$i . '}') !== false)
7219
+			$replacements['{' . $i . '}'] = array_shift($list);
7220 7220
 		else
7221 7221
 			$done = true;
7222 7222
 	}
Please login to merge, or discard this patch.