Passed
Pull Request — release-2.1 (#6344)
by Jon
04:59
created
Sources/Subs.php 2 patches
Spacing   +35 added lines, -35 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';
@@ -1039,11 +1039,11 @@  discard block
 block discarded – undo
1039 1039
 			// Anything that isn't a specification, punctuation mark, or whitespace.
1040 1040
 			'~(?<!%)\p{L}|[^\p{L}\p{P}\s]~u',
1041 1041
 			// A series of punctuation marks (except %), possibly separated by whitespace.
1042
-			'~([^%\P{P}])(\s*)(?'.'>(\1|[^%\P{Po}])\s*(?!$))*~u',
1042
+			'~([^%\P{P}])(\s*)(?' . '>(\1|[^%\P{Po}])\s*(?!$))*~u',
1043 1043
 			// Unwanted trailing punctuation and whitespace.
1044
-			'~(?'.'>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u',
1044
+			'~(?' . '>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u',
1045 1045
 			// Unwanted opening punctuation and whitespace.
1046
-			'~^\s*(?'.'>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u',
1046
+			'~^\s*(?' . '>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u',
1047 1047
 		),
1048 1048
 		array(
1049 1049
 			'',
@@ -1155,7 +1155,7 @@  discard block
 block discarded – undo
1155 1155
 				$dt_user = new DateTime('@' . $timestamp);
1156 1156
 				$temp_offset = $dtz_user->getOffset($dt_user);
1157 1157
 				if ($temp_offset !== false)
1158
-					$user_offset = $temp_offset/3600;
1158
+					$user_offset = $temp_offset / 3600;
1159 1159
 			}
1160 1160
 		}
1161 1161
 	}
@@ -1486,7 +1486,7 @@  discard block
 block discarded – undo
1486 1486
 							$width = !empty($width) ? ' width="' . $width . '"' : '';
1487 1487
 							$height = !empty($height) ? ' height="' . $height . '"' : '';
1488 1488
 
1489
-							$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>' : '');
1489
+							$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>' : '');
1490 1490
 						}
1491 1491
 						// Audio.
1492 1492
 						elseif (strpos($currentAttachment['mime_type'], 'audio/') === 0)
@@ -1494,7 +1494,7 @@  discard block
 block discarded – undo
1494 1494
 							$width = 'max-width:100%; width: ' . (!empty($width) ? $width : '400') . 'px;';
1495 1495
 							$height = !empty($height) ? 'height: ' . $height . 'px;' : '';
1496 1496
 
1497
-							$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>';
1497
+							$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>';
1498 1498
 						}
1499 1499
 						// Anything else.
1500 1500
 						else
@@ -1663,7 +1663,7 @@  discard block
 block discarded – undo
1663 1663
 				'type' => 'unparsed_commas_content',
1664 1664
 				'test' => '\d+,\d+\]',
1665 1665
 				'content' => '<a href="$1" target="_blank" rel="noopener">$1</a>',
1666
-				'validate' => function (&$tag, &$data, $disabled)
1666
+				'validate' => function(&$tag, &$data, $disabled)
1667 1667
 				{
1668 1668
 					$scheme = parse_url($data[0], PHP_URL_SCHEME);
1669 1669
 					if (empty($scheme))
@@ -2201,12 +2201,12 @@  discard block
 block discarded – undo
2201 2201
 		$codes[] = array(
2202 2202
 			'tag' => 'cowsay',
2203 2203
 			'parameters' => array(
2204
-				'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc)
2204
+				'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function($eyes) use ($smcFunc)
2205 2205
 					{
2206 2206
 						return $smcFunc['substr']($eyes . 'oo', 0, 2);
2207 2207
 					},
2208 2208
 				),
2209
-				't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => '  ', 'validate' => function ($tongue) use ($smcFunc)
2209
+				't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => '  ', 'validate' => function($tongue) use ($smcFunc)
2210 2210
 					{
2211 2211
 						return $smcFunc['substr']($tongue . '  ', 0, 2);
2212 2212
 					},
@@ -3578,7 +3578,7 @@  discard block
 block discarded – undo
3578 3578
 		if ($fp != false)
3579 3579
 		{
3580 3580
 			// Send the HEAD request (since we don't have to worry about chunked, HTTP/1.1 is fine here.)
3581
-			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");
3581
+			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");
3582 3582
 
3583 3583
 			// Read in the HTTP/1.1 or whatever.
3584 3584
 			$test = substr(fgets($fp, 11), -1);
@@ -4182,7 +4182,7 @@  discard block
 block discarded – undo
4182 4182
 	$toMinify = array();
4183 4183
 	$normal = array();
4184 4184
 
4185
-	uasort($context['css_files'], function ($a, $b)
4185
+	uasort($context['css_files'], function($a, $b)
4186 4186
 	{
4187 4187
 		return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0);
4188 4188
 	});
@@ -5479,7 +5479,7 @@  discard block
 block discarded – undo
5479 5479
 			{
5480 5480
 				fwrite($fp, 'GET ' . ($match[6] !== '/' ? str_replace(' ', '%20', $match[6]) : '') . ' HTTP/1.0' . "\r\n");
5481 5481
 				fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n");
5482
-				fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n");
5482
+				fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n");
5483 5483
 				if ($keep_alive)
5484 5484
 					fwrite($fp, 'connection: Keep-Alive' . "\r\n\r\n");
5485 5485
 				else
@@ -5489,7 +5489,7 @@  discard block
 block discarded – undo
5489 5489
 			{
5490 5490
 				fwrite($fp, 'POST ' . ($match[6] !== '/' ? $match[6] : '') . ' HTTP/1.0' . "\r\n");
5491 5491
 				fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n");
5492
-				fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n");
5492
+				fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n");
5493 5493
 				if ($keep_alive)
5494 5494
 					fwrite($fp, 'connection: Keep-Alive' . "\r\n");
5495 5495
 				else
@@ -5737,13 +5737,13 @@  discard block
 block discarded – undo
5737 5737
 
5738 5738
 	// UTF-8 occurences of MS special characters
5739 5739
 	$findchars_utf8 = array(
5740
-		"\xe2\x80\x9a",	// single low-9 quotation mark
5741
-		"\xe2\x80\x9e",	// double low-9 quotation mark
5742
-		"\xe2\x80\xa6",	// horizontal ellipsis
5743
-		"\xe2\x80\x98",	// left single curly quote
5744
-		"\xe2\x80\x99",	// right single curly quote
5745
-		"\xe2\x80\x9c",	// left double curly quote
5746
-		"\xe2\x80\x9d",	// right double curly quote
5740
+		"\xe2\x80\x9a", // single low-9 quotation mark
5741
+		"\xe2\x80\x9e", // double low-9 quotation mark
5742
+		"\xe2\x80\xa6", // horizontal ellipsis
5743
+		"\xe2\x80\x98", // left single curly quote
5744
+		"\xe2\x80\x99", // right single curly quote
5745
+		"\xe2\x80\x9c", // left double curly quote
5746
+		"\xe2\x80\x9d", // right double curly quote
5747 5747
 	);
5748 5748
 
5749 5749
 	// windows 1252 / iso equivalents
@@ -5759,13 +5759,13 @@  discard block
 block discarded – undo
5759 5759
 
5760 5760
 	// safe replacements
5761 5761
 	$replacechars = array(
5762
-		',',	// &sbquo;
5763
-		',,',	// &bdquo;
5764
-		'...',	// &hellip;
5765
-		"'",	// &lsquo;
5766
-		"'",	// &rsquo;
5767
-		'"',	// &ldquo;
5768
-		'"',	// &rdquo;
5762
+		',', // &sbquo;
5763
+		',,', // &bdquo;
5764
+		'...', // &hellip;
5765
+		"'", // &lsquo;
5766
+		"'", // &rsquo;
5767
+		'"', // &ldquo;
5768
+		'"', // &rdquo;
5769 5769
 	);
5770 5770
 
5771 5771
 	if ($context['utf8'])
@@ -6099,7 +6099,7 @@  discard block
 block discarded – undo
6099 6099
 			$desc = implode(', ', array_slice(array_unique($tzvalue['locations']), 0, 5)) . (count($tzvalue['locations']) > 5 ? ', ' . $txt['etc'] : '');
6100 6100
 
6101 6101
 		// We don't want abbreviations like '+03' or '-11'.
6102
-		$abbrs = array_filter($tzvalue['abbrs'], function ($abbr) {
6102
+		$abbrs = array_filter($tzvalue['abbrs'], function($abbr) {
6103 6103
 			return !strspn($abbr, '+-');
6104 6104
 		});
6105 6105
 		$abbrs = count($abbrs) == count($tzvalue['abbrs']) ? array_unique($abbrs) : array();
@@ -7008,7 +7008,7 @@  discard block
 block discarded – undo
7008 7008
 			EXISTS (
7009 7009
 				SELECT bpv.id_board
7010 7010
 				FROM ' . $db_prefix . 'board_permissions_view AS bpv
7011
-				WHERE bpv.id_group IN ('. implode(',', $groups) .')
7011
+				WHERE bpv.id_group IN ('. implode(',', $groups) . ')
7012 7012
 					AND bpv.deny = 0
7013 7013
 					AND bpv.id_board = b.id_board
7014 7014
 			)';
@@ -7018,7 +7018,7 @@  discard block
 block discarded – undo
7018 7018
 			AND NOT EXISTS (
7019 7019
 				SELECT bpv.id_board
7020 7020
 				FROM ' . $db_prefix . 'board_permissions_view AS bpv
7021
-				WHERE bpv.id_group IN ( '. implode(',', $groups) .')
7021
+				WHERE bpv.id_group IN ( '. implode(',', $groups) . ')
7022 7022
 					AND bpv.deny = 1
7023 7023
 					AND bpv.id_board = b.id_board
7024 7024
 			)';
@@ -7289,8 +7289,8 @@  discard block
 block discarded – undo
7289 7289
 	$i = 0;
7290 7290
 	while (empty($done))
7291 7291
 	{
7292
-		if (strpos($format, '{'. --$i . '}') !== false)
7293
-			$replacements['{'. $i . '}'] = array_pop($list);
7292
+		if (strpos($format, '{' . --$i . '}') !== false)
7293
+			$replacements['{' . $i . '}'] = array_pop($list);
7294 7294
 		else
7295 7295
 			$done = true;
7296 7296
 	}
@@ -7300,8 +7300,8 @@  discard block
 block discarded – undo
7300 7300
 	$i = 0;
7301 7301
 	while (empty($done))
7302 7302
 	{
7303
-		if (strpos($format, '{'. ++$i . '}') !== false)
7304
-			$replacements['{'. $i . '}'] = array_shift($list);
7303
+		if (strpos($format, '{' . ++$i . '}') !== false)
7304
+			$replacements['{' . $i . '}'] = array_shift($list);
7305 7305
 		else
7306 7306
 			$done = true;
7307 7307
 	}
Please login to merge, or discard this patch.
Braces   +7 added lines, -10 removed lines patch added patch discarded remove patch
@@ -279,7 +279,6 @@  discard block
 block discarded – undo
279 279
 		$condition = 'id_member IN ({array_int:members})';
280 280
 		$parameters['members'] = $members;
281 281
 	}
282
-
283 282
 	elseif ($members === null)
284 283
 		$condition = '1=1';
285 284
 
@@ -382,11 +381,9 @@  discard block
 block discarded – undo
382 381
 				$val = $val . ' END';
383 382
 				$type = 'raw';
384 383
 			}
385
-
386 384
 			else
387 385
 				$val = alert_count($members, true);
388 386
 		}
389
-
390 387
 		elseif ($type == 'int' && ($val === '+' || $val === '-'))
391 388
 		{
392 389
 			$val = $var . ' ' . $val . ' 1';
@@ -2202,12 +2199,12 @@  discard block
 block discarded – undo
2202 2199
 			'tag' => 'cowsay',
2203 2200
 			'parameters' => array(
2204 2201
 				'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc)
2205
-					{
2202
+				{
2206 2203
 						return $smcFunc['substr']($eyes . 'oo', 0, 2);
2207 2204
 					},
2208 2205
 				),
2209 2206
 				't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => '  ', 'validate' => function ($tongue) use ($smcFunc)
2210
-					{
2207
+				{
2211 2208
 						return $smcFunc['substr']($tongue . '  ', 0, 2);
2212 2209
 					},
2213 2210
 				),
@@ -3314,7 +3311,7 @@  discard block
 block discarded – undo
3314 3311
 
3315 3312
 	// Replace away!
3316 3313
 	$message = preg_replace_callback($smileyPregSearch, function($matches) use ($smileyPregReplacements)
3317
-		{
3314
+	{
3318 3315
 			return $smileyPregReplacements[$matches[1]];
3319 3316
 		}, $message);
3320 3317
 }
@@ -4112,7 +4109,6 @@  discard block
 block discarded – undo
4112 4109
 				if (!isset($minSeed) && isset($js_file['options']['seed']))
4113 4110
 					$minSeed = $js_file['options']['seed'];
4114 4111
 			}
4115
-
4116 4112
 			else
4117 4113
 			{
4118 4114
 				echo '
@@ -6029,7 +6025,8 @@  discard block
 block discarded – undo
6029 6025
 			$zones[$tzkey]['tzid'] = $tzid;
6030 6026
 			$zones[$tzkey]['dst_type'] = count($tzinfo) > 1 ? 1 : ($tzinfo[0]['isdst'] ? 2 : 0);
6031 6027
 
6032
-			foreach ($tzinfo as $transition) {
6028
+			foreach ($tzinfo as $transition)
6029
+			{
6033 6030
 				$zones[$tzkey]['abbrs'][] = $transition['abbr'];
6034 6031
 			}
6035 6032
 
@@ -6114,7 +6111,8 @@  discard block
 block discarded – undo
6114 6111
 			$desc = implode(', ', array_slice(array_unique($tzvalue['locations']), 0, 5)) . (count($tzvalue['locations']) > 5 ? ', ' . $txt['etc'] : '');
6115 6112
 
6116 6113
 		// We don't want abbreviations like '+03' or '-11'.
6117
-		$abbrs = array_filter($tzvalue['abbrs'], function ($abbr) {
6114
+		$abbrs = array_filter($tzvalue['abbrs'], function ($abbr)
6115
+		{
6118 6116
 			return !strspn($abbr, '+-');
6119 6117
 		});
6120 6118
 		$abbrs = count($abbrs) == count($tzvalue['abbrs']) ? array_unique($abbrs) : array();
@@ -6462,7 +6460,6 @@  discard block
 block discarded – undo
6462 6460
 			$isWritable = true;
6463 6461
 			break;
6464 6462
 		}
6465
-
6466 6463
 		else
6467 6464
 			@chmod($file, $val);
6468 6465
 	}
Please login to merge, or discard this patch.
Sources/Subs-Timezones.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
 		output will be 'Mountain Time (MST/MDT)' for America/Denver vs.
51 51
 		'Mountain Standard Time (MST)' for America/Phoenix.
52 52
 	 */
53
-	$tzid_metazones =  array(
53
+	$tzid_metazones = array(
54 54
 		// Africa_Central (no DST)
55 55
 		'Africa/Maputo' => 'Africa_Central',
56 56
 
Please login to merge, or discard this patch.