Passed
Pull Request — release-2.1 (#6717)
by
unknown
05:50
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';
@@ -1040,11 +1040,11 @@  discard block
 block discarded – undo
1040 1040
 			// Anything that isn't a specification, punctuation mark, or whitespace.
1041 1041
 			'~(?<!%)\p{L}|[^\p{L}\p{P}\s]~u',
1042 1042
 			// A series of punctuation marks (except %), possibly separated by whitespace.
1043
-			'~([^%\P{P}])(\s*)(?'.'>(\1|[^%\P{Po}])\s*(?!$))*~u',
1043
+			'~([^%\P{P}])(\s*)(?' . '>(\1|[^%\P{Po}])\s*(?!$))*~u',
1044 1044
 			// Unwanted trailing punctuation and whitespace.
1045
-			'~(?'.'>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u',
1045
+			'~(?' . '>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u',
1046 1046
 			// Unwanted opening punctuation and whitespace.
1047
-			'~^\s*(?'.'>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u',
1047
+			'~^\s*(?' . '>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u',
1048 1048
 		),
1049 1049
 		array(
1050 1050
 			'',
@@ -1442,7 +1442,7 @@  discard block
 block discarded – undo
1442 1442
 								$returnContext .= '<img src="' . $currentAttachment['href'] . '"' . $alt . $title . ' class="bbc_img"></a>';
1443 1443
 							else
1444 1444
 							{
1445
-								$width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"': '';
1445
+								$width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"' : '';
1446 1446
 								$height = !empty($params['{height}']) ? 'height="' . $params['{height}'] . '"' : '';
1447 1447
 								$returnContext .= '<img src="' . $currentAttachment['href'] . ';image"' . $alt . $title . $width . $height . ' class="bbc_img resized"/>';
1448 1448
 							}
@@ -1453,7 +1453,7 @@  discard block
 block discarded – undo
1453 1453
 							$width = !empty($width) ? ' width="' . $width . '"' : '';
1454 1454
 							$height = !empty($height) ? ' height="' . $height . '"' : '';
1455 1455
 
1456
-							$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>' : '');
1456
+							$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 1457
 						}
1458 1458
 						// Audio.
1459 1459
 						elseif (strpos($currentAttachment['mime_type'], 'audio/') === 0)
@@ -1461,7 +1461,7 @@  discard block
 block discarded – undo
1461 1461
 							$width = 'max-width:100%; width: ' . (!empty($width) ? $width : '400') . 'px;';
1462 1462
 							$height = !empty($height) ? 'height: ' . $height . 'px;' : '';
1463 1463
 
1464
-							$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>';
1464
+							$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 1465
 						}
1466 1466
 						// Anything else.
1467 1467
 						else
@@ -1630,7 +1630,7 @@  discard block
 block discarded – undo
1630 1630
 				'type' => 'unparsed_commas_content',
1631 1631
 				'test' => '\d+,\d+\]',
1632 1632
 				'content' => '<a href="$1" target="_blank" rel="noopener">$1</a>',
1633
-				'validate' => function (&$tag, &$data, $disabled)
1633
+				'validate' => function(&$tag, &$data, $disabled)
1634 1634
 				{
1635 1635
 					$scheme = parse_url($data[0], PHP_URL_SCHEME);
1636 1636
 					if (empty($scheme))
@@ -1743,8 +1743,8 @@  discard block
 block discarded – undo
1743 1743
 					else
1744 1744
 						$url = get_proxied_url($url);
1745 1745
 
1746
-					$alt = !empty($params['{alt}']) ? ' alt="' . $params['{alt}']. '"' : '';
1747
-					$title = !empty($params['{title}']) ? ' title="' . $params['{title}']. '"' : '';
1746
+					$alt = !empty($params['{alt}']) ? ' alt="' . $params['{alt}'] . '"' : '';
1747
+					$title = !empty($params['{title}']) ? ' title="' . $params['{title}'] . '"' : '';
1748 1748
 
1749 1749
 					$data = '<img src="' . $url . '"' . $alt . $title . $params['{width}'] . $params['{height}'] . 'class="bbc_img' . (!empty($params['{width}']) || !empty($params['{height}']) ? ' resized' : '') . '" loading="lazy">';
1750 1750
 				},
@@ -2158,12 +2158,12 @@  discard block
 block discarded – undo
2158 2158
 		$codes[] = array(
2159 2159
 			'tag' => 'cowsay',
2160 2160
 			'parameters' => array(
2161
-				'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc)
2161
+				'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function($eyes) use ($smcFunc)
2162 2162
 					{
2163 2163
 						return $smcFunc['substr']($eyes . 'oo', 0, 2);
2164 2164
 					},
2165 2165
 				),
2166
-				't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => '  ', 'validate' => function ($tongue) use ($smcFunc)
2166
+				't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => '  ', 'validate' => function($tongue) use ($smcFunc)
2167 2167
 					{
2168 2168
 						return $smcFunc['substr']($tongue . '  ', 0, 2);
2169 2169
 					},
@@ -3544,7 +3544,7 @@  discard block
 block discarded – undo
3544 3544
 		if ($fp != false)
3545 3545
 		{
3546 3546
 			// Send the HEAD request (since we don't have to worry about chunked, HTTP/1.1 is fine here.)
3547
-			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");
3547
+			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");
3548 3548
 
3549 3549
 			// Read in the HTTP/1.1 or whatever.
3550 3550
 			$test = substr(fgets($fp, 11), -1);
@@ -4161,7 +4161,7 @@  discard block
 block discarded – undo
4161 4161
 	$toMinify = array();
4162 4162
 	$normal = array();
4163 4163
 
4164
-	uasort($context['css_files'], function ($a, $b)
4164
+	uasort($context['css_files'], function($a, $b)
4165 4165
 	{
4166 4166
 		return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0);
4167 4167
 	});
@@ -5458,7 +5458,7 @@  discard block
 block discarded – undo
5458 5458
 			{
5459 5459
 				fwrite($fp, 'GET ' . ($match[6] !== '/' ? str_replace(' ', '%20', $match[6]) : '') . ' HTTP/1.0' . "\r\n");
5460 5460
 				fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n");
5461
-				fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n");
5461
+				fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n");
5462 5462
 				if ($keep_alive)
5463 5463
 					fwrite($fp, 'connection: Keep-Alive' . "\r\n\r\n");
5464 5464
 				else
@@ -5468,7 +5468,7 @@  discard block
 block discarded – undo
5468 5468
 			{
5469 5469
 				fwrite($fp, 'POST ' . ($match[6] !== '/' ? $match[6] : '') . ' HTTP/1.0' . "\r\n");
5470 5470
 				fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n");
5471
-				fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n");
5471
+				fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n");
5472 5472
 				if ($keep_alive)
5473 5473
 					fwrite($fp, 'connection: Keep-Alive' . "\r\n");
5474 5474
 				else
@@ -5717,13 +5717,13 @@  discard block
 block discarded – undo
5717 5717
 
5718 5718
 	// UTF-8 occurences of MS special characters
5719 5719
 	$findchars_utf8 = array(
5720
-		"\xe2\x80\x9a",	// single low-9 quotation mark
5721
-		"\xe2\x80\x9e",	// double low-9 quotation mark
5722
-		"\xe2\x80\xa6",	// horizontal ellipsis
5723
-		"\xe2\x80\x98",	// left single curly quote
5724
-		"\xe2\x80\x99",	// right single curly quote
5725
-		"\xe2\x80\x9c",	// left double curly quote
5726
-		"\xe2\x80\x9d",	// right double curly quote
5720
+		"\xe2\x80\x9a", // single low-9 quotation mark
5721
+		"\xe2\x80\x9e", // double low-9 quotation mark
5722
+		"\xe2\x80\xa6", // horizontal ellipsis
5723
+		"\xe2\x80\x98", // left single curly quote
5724
+		"\xe2\x80\x99", // right single curly quote
5725
+		"\xe2\x80\x9c", // left double curly quote
5726
+		"\xe2\x80\x9d", // right double curly quote
5727 5727
 	);
5728 5728
 
5729 5729
 	// windows 1252 / iso equivalents
@@ -5739,13 +5739,13 @@  discard block
 block discarded – undo
5739 5739
 
5740 5740
 	// safe replacements
5741 5741
 	$replacechars = array(
5742
-		',',	// &sbquo;
5743
-		',,',	// &bdquo;
5744
-		'...',	// &hellip;
5745
-		"'",	// &lsquo;
5746
-		"'",	// &rsquo;
5747
-		'"',	// &ldquo;
5748
-		'"',	// &rdquo;
5742
+		',', // &sbquo;
5743
+		',,', // &bdquo;
5744
+		'...', // &hellip;
5745
+		"'", // &lsquo;
5746
+		"'", // &rsquo;
5747
+		'"', // &ldquo;
5748
+		'"', // &rdquo;
5749 5749
 	);
5750 5750
 
5751 5751
 	if ($context['utf8'])
@@ -6090,7 +6090,7 @@  discard block
 block discarded – undo
6090 6090
 			$desc = implode(', ', array_slice(array_unique($tzvalue['locations']), 0, 5)) . (count($tzvalue['locations']) > 5 ? ', ' . $txt['etc'] : '');
6091 6091
 
6092 6092
 		// We don't want abbreviations like '+03' or '-11'.
6093
-		$abbrs = array_filter($tzvalue['abbrs'], function ($abbr) {
6093
+		$abbrs = array_filter($tzvalue['abbrs'], function($abbr) {
6094 6094
 			return !strspn($abbr, '+-');
6095 6095
 		});
6096 6096
 		$abbrs = count($abbrs) == count($tzvalue['abbrs']) ? array_unique($abbrs) : array();
@@ -7054,7 +7054,7 @@  discard block
 block discarded – undo
7054 7054
 			EXISTS (
7055 7055
 				SELECT bpv.id_board
7056 7056
 				FROM ' . $db_prefix . 'board_permissions_view AS bpv
7057
-				WHERE bpv.id_group IN ('. implode(',', $groups) .')
7057
+				WHERE bpv.id_group IN ('. implode(',', $groups) . ')
7058 7058
 					AND bpv.deny = 0
7059 7059
 					AND bpv.id_board = b.id_board
7060 7060
 			)';
@@ -7064,7 +7064,7 @@  discard block
 block discarded – undo
7064 7064
 			AND NOT EXISTS (
7065 7065
 				SELECT bpv.id_board
7066 7066
 				FROM ' . $db_prefix . 'board_permissions_view AS bpv
7067
-				WHERE bpv.id_group IN ( '. implode(',', $groups) .')
7067
+				WHERE bpv.id_group IN ( '. implode(',', $groups) . ')
7068 7068
 					AND bpv.deny = 1
7069 7069
 					AND bpv.id_board = b.id_board
7070 7070
 			)';
@@ -7335,8 +7335,8 @@  discard block
 block discarded – undo
7335 7335
 	$i = 0;
7336 7336
 	while (empty($done))
7337 7337
 	{
7338
-		if (strpos($format, '{'. --$i . '}') !== false)
7339
-			$replacements['{'. $i . '}'] = array_pop($list);
7338
+		if (strpos($format, '{' . --$i . '}') !== false)
7339
+			$replacements['{' . $i . '}'] = array_pop($list);
7340 7340
 		else
7341 7341
 			$done = true;
7342 7342
 	}
@@ -7346,8 +7346,8 @@  discard block
 block discarded – undo
7346 7346
 	$i = 0;
7347 7347
 	while (empty($done))
7348 7348
 	{
7349
-		if (strpos($format, '{'. ++$i . '}') !== false)
7350
-			$replacements['{'. $i . '}'] = array_shift($list);
7349
+		if (strpos($format, '{' . ++$i . '}') !== false)
7350
+			$replacements['{' . $i . '}'] = array_shift($list);
7351 7351
 		else
7352 7352
 			$done = true;
7353 7353
 	}
Please login to merge, or discard this patch.