Passed
Pull Request — release-2.1 (#6717)
by
unknown
04:42
created
Sources/Subs.php 1 patch
Spacing   +37 added lines, -37 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';
@@ -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
 			'',
@@ -1443,7 +1443,7 @@  discard block
 block discarded – undo
1443 1443
 								$returnContext .= '<img src="' . $currentAttachment['href'] . '"' . $alt . $title . ' class="bbc_img"></a>';
1444 1444
 							else
1445 1445
 							{
1446
-								$width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"': '';
1446
+								$width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"' : '';
1447 1447
 								$height = !empty($params['{height}']) ? 'height="' . $params['{height}'] . '"' : '';
1448 1448
 								$returnContext .= '<img src="' . $currentAttachment['href'] . ';image"' . $alt . $title . $width . $height . ' class="bbc_img resized"/>';
1449 1449
 							}
@@ -1454,7 +1454,7 @@  discard block
 block discarded – undo
1454 1454
 							$width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"' : '';
1455 1455
 							$height = !empty($params['{height}']) ? ' height="' . $params['{height}'] . '"' : '';
1456 1456
 
1457
-							$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>' : '');
1457
+							$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>' : '');
1458 1458
 						}
1459 1459
 						// Audio.
1460 1460
 						elseif (strpos($currentAttachment['mime_type'], 'audio/') === 0)
@@ -1462,7 +1462,7 @@  discard block
 block discarded – undo
1462 1462
 							$width = 'max-width:100%; width: ' . (!empty($params['{width}']) ? $params['{width}'] : '400') . 'px;';
1463 1463
 							$height = !empty($params['{height}']) ? 'height: ' . $params['{height}'] . 'px;' : '';
1464 1464
 
1465
-							$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>';
1465
+							$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>';
1466 1466
 						}
1467 1467
 						// Anything else.
1468 1468
 						else
@@ -1631,7 +1631,7 @@  discard block
 block discarded – undo
1631 1631
 				'type' => 'unparsed_commas_content',
1632 1632
 				'test' => '\d+,\d+\]',
1633 1633
 				'content' => '<a href="$1" target="_blank" rel="noopener">$1</a>',
1634
-				'validate' => function (&$tag, &$data, $disabled)
1634
+				'validate' => function(&$tag, &$data, $disabled)
1635 1635
 				{
1636 1636
 					$scheme = parse_url($data[0], PHP_URL_SCHEME);
1637 1637
 					if (empty($scheme))
@@ -1744,8 +1744,8 @@  discard block
 block discarded – undo
1744 1744
 					else
1745 1745
 						$url = get_proxied_url($url);
1746 1746
 
1747
-					$alt = !empty($params['{alt}']) ? ' alt="' . $params['{alt}']. '"' : '';
1748
-					$title = !empty($params['{title}']) ? ' title="' . $params['{title}']. '"' : '';
1747
+					$alt = !empty($params['{alt}']) ? ' alt="' . $params['{alt}'] . '"' : '';
1748
+					$title = !empty($params['{title}']) ? ' title="' . $params['{title}'] . '"' : '';
1749 1749
 
1750 1750
 					$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">';
1751 1751
 				},
@@ -2159,12 +2159,12 @@  discard block
 block discarded – undo
2159 2159
 		$codes[] = array(
2160 2160
 			'tag' => 'cowsay',
2161 2161
 			'parameters' => array(
2162
-				'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc)
2162
+				'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function($eyes) use ($smcFunc)
2163 2163
 					{
2164 2164
 						return $smcFunc['substr']($eyes . 'oo', 0, 2);
2165 2165
 					},
2166 2166
 				),
2167
-				't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => '  ', 'validate' => function ($tongue) use ($smcFunc)
2167
+				't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => '  ', 'validate' => function($tongue) use ($smcFunc)
2168 2168
 					{
2169 2169
 						return $smcFunc['substr']($tongue . '  ', 0, 2);
2170 2170
 					},
@@ -3548,7 +3548,7 @@  discard block
 block discarded – undo
3548 3548
 		if ($fp != false)
3549 3549
 		{
3550 3550
 			// Send the HEAD request (since we don't have to worry about chunked, HTTP/1.1 is fine here.)
3551
-			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");
3551
+			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");
3552 3552
 
3553 3553
 			// Read in the HTTP/1.1 or whatever.
3554 3554
 			$test = substr(fgets($fp, 11), -1);
@@ -4165,7 +4165,7 @@  discard block
 block discarded – undo
4165 4165
 	$toMinify = array();
4166 4166
 	$normal = array();
4167 4167
 
4168
-	uasort($context['css_files'], function ($a, $b)
4168
+	uasort($context['css_files'], function($a, $b)
4169 4169
 	{
4170 4170
 		return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0);
4171 4171
 	});
@@ -5462,7 +5462,7 @@  discard block
 block discarded – undo
5462 5462
 			{
5463 5463
 				fwrite($fp, 'GET ' . ($match[6] !== '/' ? str_replace(' ', '%20', $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\r\n");
5468 5468
 				else
@@ -5472,7 +5472,7 @@  discard block
 block discarded – undo
5472 5472
 			{
5473 5473
 				fwrite($fp, 'POST ' . ($match[6] !== '/' ? $match[6] : '') . ' HTTP/1.0' . "\r\n");
5474 5474
 				fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n");
5475
-				fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n");
5475
+				fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n");
5476 5476
 				if ($keep_alive)
5477 5477
 					fwrite($fp, 'connection: Keep-Alive' . "\r\n");
5478 5478
 				else
@@ -5721,13 +5721,13 @@  discard block
 block discarded – undo
5721 5721
 
5722 5722
 	// UTF-8 occurences of MS special characters
5723 5723
 	$findchars_utf8 = array(
5724
-		"\xe2\x80\x9a",	// single low-9 quotation mark
5725
-		"\xe2\x80\x9e",	// double low-9 quotation mark
5726
-		"\xe2\x80\xa6",	// horizontal ellipsis
5727
-		"\xe2\x80\x98",	// left single curly quote
5728
-		"\xe2\x80\x99",	// right single curly quote
5729
-		"\xe2\x80\x9c",	// left double curly quote
5730
-		"\xe2\x80\x9d",	// right double curly quote
5724
+		"\xe2\x80\x9a", // single low-9 quotation mark
5725
+		"\xe2\x80\x9e", // double low-9 quotation mark
5726
+		"\xe2\x80\xa6", // horizontal ellipsis
5727
+		"\xe2\x80\x98", // left single curly quote
5728
+		"\xe2\x80\x99", // right single curly quote
5729
+		"\xe2\x80\x9c", // left double curly quote
5730
+		"\xe2\x80\x9d", // right double curly quote
5731 5731
 	);
5732 5732
 
5733 5733
 	// windows 1252 / iso equivalents
@@ -5743,13 +5743,13 @@  discard block
 block discarded – undo
5743 5743
 
5744 5744
 	// safe replacements
5745 5745
 	$replacechars = array(
5746
-		',',	// &sbquo;
5747
-		',,',	// &bdquo;
5748
-		'...',	// &hellip;
5749
-		"'",	// &lsquo;
5750
-		"'",	// &rsquo;
5751
-		'"',	// &ldquo;
5752
-		'"',	// &rdquo;
5746
+		',', // &sbquo;
5747
+		',,', // &bdquo;
5748
+		'...', // &hellip;
5749
+		"'", // &lsquo;
5750
+		"'", // &rsquo;
5751
+		'"', // &ldquo;
5752
+		'"', // &rdquo;
5753 5753
 	);
5754 5754
 
5755 5755
 	if ($context['utf8'])
@@ -6094,7 +6094,7 @@  discard block
 block discarded – undo
6094 6094
 			$desc = implode(', ', array_slice(array_unique($tzvalue['locations']), 0, 5)) . (count($tzvalue['locations']) > 5 ? ', ' . $txt['etc'] : '');
6095 6095
 
6096 6096
 		// We don't want abbreviations like '+03' or '-11'.
6097
-		$abbrs = array_filter($tzvalue['abbrs'], function ($abbr) {
6097
+		$abbrs = array_filter($tzvalue['abbrs'], function($abbr) {
6098 6098
 			return !strspn($abbr, '+-');
6099 6099
 		});
6100 6100
 		$abbrs = count($abbrs) == count($tzvalue['abbrs']) ? array_unique($abbrs) : array();
@@ -7058,7 +7058,7 @@  discard block
 block discarded – undo
7058 7058
 			EXISTS (
7059 7059
 				SELECT bpv.id_board
7060 7060
 				FROM ' . $db_prefix . 'board_permissions_view AS bpv
7061
-				WHERE bpv.id_group IN ('. implode(',', $groups) .')
7061
+				WHERE bpv.id_group IN ('. implode(',', $groups) . ')
7062 7062
 					AND bpv.deny = 0
7063 7063
 					AND bpv.id_board = b.id_board
7064 7064
 			)';
@@ -7068,7 +7068,7 @@  discard block
 block discarded – undo
7068 7068
 			AND NOT EXISTS (
7069 7069
 				SELECT bpv.id_board
7070 7070
 				FROM ' . $db_prefix . 'board_permissions_view AS bpv
7071
-				WHERE bpv.id_group IN ( '. implode(',', $groups) .')
7071
+				WHERE bpv.id_group IN ( '. implode(',', $groups) . ')
7072 7072
 					AND bpv.deny = 1
7073 7073
 					AND bpv.id_board = b.id_board
7074 7074
 			)';
@@ -7344,8 +7344,8 @@  discard block
 block discarded – undo
7344 7344
 	$i = 0;
7345 7345
 	while (empty($done))
7346 7346
 	{
7347
-		if (strpos($format, '{'. --$i . '}') !== false)
7348
-			$replacements['{'. $i . '}'] = array_pop($list);
7347
+		if (strpos($format, '{' . --$i . '}') !== false)
7348
+			$replacements['{' . $i . '}'] = array_pop($list);
7349 7349
 		else
7350 7350
 			$done = true;
7351 7351
 	}
@@ -7355,8 +7355,8 @@  discard block
 block discarded – undo
7355 7355
 	$i = 0;
7356 7356
 	while (empty($done))
7357 7357
 	{
7358
-		if (strpos($format, '{'. ++$i . '}') !== false)
7359
-			$replacements['{'. $i . '}'] = array_shift($list);
7358
+		if (strpos($format, '{' . ++$i . '}') !== false)
7359
+			$replacements['{' . $i . '}'] = array_shift($list);
7360 7360
 		else
7361 7361
 			$done = true;
7362 7362
 	}
Please login to merge, or discard this patch.