Passed
Push — release-2.1 ( b7b9b9...450da8 )
by Mathias
07:12
created
other/upgrade.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -295,7 +295,8 @@  discard block
 block discarded – undo
295 295
 		// Call the step and if it returns false that means pause!
296 296
 		if (function_exists($step[2]) && $step[2]() === false)
297 297
 			break;
298
-		elseif (function_exists($step[2])) {
298
+		elseif (function_exists($step[2]))
299
+		{
299 300
 			//Start each new step with this unset, so the 'normal' template is called first
300 301
 			unset($_GET['xml']);
301 302
 			//Clear out warnings at the start of each step
@@ -2915,7 +2916,8 @@  discard block
 block discarded – undo
2915 2916
 		$upcontext['step_progress'] = (int) (($upcontext['cur_table_num'] / $upcontext['table_count']) * 100);
2916 2917
 
2917 2918
 		// Make sure we're ready & have painted the template before proceeding
2918
-		if ($support_js && !isset($_GET['xml'])) {
2919
+		if ($support_js && !isset($_GET['xml']))
2920
+		{
2919 2921
 			$_GET['substep'] = 0;
2920 2922
 			return false;
2921 2923
 		}
@@ -2968,7 +2970,8 @@  discard block
 block discarded – undo
2968 2970
 						list($charset) = explode('_', $collation);
2969 2971
 
2970 2972
 						// Build structure of columns to operate on organized by charset; only operate on columns not yet utf8
2971
-						if ($charset != 'utf8') {
2973
+						if ($charset != 'utf8')
2974
+						{
2972 2975
 							if (!isset($table_charsets[$charset]))
2973 2976
 								$table_charsets[$charset] = array();
2974 2977
 
Please login to merge, or discard this patch.
other/install.php 1 patch
Braces   +16 added lines, -8 removed lines patch added patch discarded remove patch
@@ -36,7 +36,8 @@  discard block
 block discarded – undo
36 36
 		'default_password' => 'mysql.default_password',
37 37
 		'default_host' => 'mysql.default_host',
38 38
 		'default_port' => 'mysql.default_port',
39
-		'utf8_support' => function() {
39
+		'utf8_support' => function()
40
+		{
40 41
 			return true;
41 42
 		},
42 43
 		'utf8_version' => '5.0.22',
@@ -44,7 +45,8 @@  discard block
 block discarded – undo
44 45
 		'utf8_default' => true,
45 46
 		'utf8_required' => true,
46 47
 		'alter_support' => true,
47
-		'validate_prefix' => function(&$value) {
48
+		'validate_prefix' => function(&$value)
49
+		{
48 50
 			$value = preg_replace('~[^A-Za-z0-9_\$]~', '', $value);
49 51
 			return true;
50 52
 		},
@@ -58,7 +60,8 @@  discard block
 block discarded – undo
58 60
 		'always_has_db' => true,
59 61
 		'utf8_default' => true,
60 62
 		'utf8_required' => true,
61
-		'utf8_support' => function() {
63
+		'utf8_support' => function()
64
+		{
62 65
 			$request = pg_query('SHOW SERVER_ENCODING');
63 66
 
64 67
 			list ($charcode) = pg_fetch_row($request);
@@ -70,7 +73,8 @@  discard block
 block discarded – undo
70 73
 		},
71 74
 		'utf8_version' => '8.0',
72 75
 		'utf8_version_check' => '$request = pg_query(\'SELECT version()\'); list ($version) = pg_fetch_row($request); list($pgl, $version) = explode(" ", $version); return $version;',
73
-		'validate_prefix' => function(&$value) {
76
+		'validate_prefix' => function(&$value)
77
+		{
74 78
 			global $txt;
75 79
 
76 80
 			$value = preg_replace('~[^A-Za-z0-9_\$]~', '', $value);
@@ -963,13 +967,15 @@  discard block
 block discarded – undo
963 967
 
964 968
 	// If redirect in effect, force ssl ON
965 969
 	require_once(dirname(__FILE__) . '/Sources/Subs.php');
966
-	if (https_redirect_active($incontext['detected_url'])) {
970
+	if (https_redirect_active($incontext['detected_url']))
971
+	{
967 972
 		$incontext['ssl_chkbx_protected'] = true;
968 973
 		$incontext['ssl_chkbx_checked'] = true;
969 974
 		$_POST['force_ssl'] = true;
970 975
 	}
971 976
 	// If no cert, make sure ssl stays OFF
972
-	if (!ssl_cert_found($incontext['detected_url'])) {
977
+	if (!ssl_cert_found($incontext['detected_url']))
978
+	{
973 979
 		$incontext['ssl_chkbx_protected'] = true;
974 980
 		$incontext['ssl_chkbx_checked'] = false;
975 981
 	}
@@ -1438,7 +1444,8 @@  discard block
 block discarded – undo
1438 1444
 	reloadSettings();
1439 1445
 
1440 1446
 	// We need this to properly hash the password for Admin
1441
-	$smcFunc['strtolower'] = $db_character_set != 'utf8' && $txt['lang_character_set'] != 'UTF-8' ? 'strtolower' : function($string) {
1447
+	$smcFunc['strtolower'] = $db_character_set != 'utf8' && $txt['lang_character_set'] != 'UTF-8' ? 'strtolower' : function($string)
1448
+	{
1442 1449
 			global $sourcedir;
1443 1450
 			if (function_exists('mb_strtolower'))
1444 1451
 				return mb_strtolower($string, 'UTF-8');
@@ -1696,7 +1703,8 @@  discard block
 block discarded – undo
1696 1703
 
1697 1704
 	// This function is needed to do the updateStats('subject') call.
1698 1705
 	$smcFunc['strtolower'] = $db_character_set != 'utf8' && $txt['lang_character_set'] != 'UTF-8' ? 'strtolower' :
1699
-		function($string){
1706
+		function($string)
1707
+		{
1700 1708
 			global $sourcedir;
1701 1709
 			if (function_exists('mb_strtolower'))
1702 1710
 				return mb_strtolower($string, 'UTF-8');
Please login to merge, or discard this patch.
Sources/Subs.php 1 patch
Braces   +20 added lines, -12 removed lines patch added patch discarded remove patch
@@ -302,7 +302,6 @@  discard block
 block discarded – undo
302 302
 		$condition = 'id_member IN ({array_int:members})';
303 303
 		$parameters['members'] = $members;
304 304
 	}
305
-
306 305
 	elseif ($members === null)
307 306
 		$condition = '1=1';
308 307
 
@@ -1739,7 +1738,7 @@  discard block
 block discarded – undo
1739 1738
 				'before' => '<span style="text-shadow: $1 $2">',
1740 1739
 				'after' => '</span>',
1741 1740
 				'validate' => function(&$tag, &$data, $disabled)
1742
-					{
1741
+				{
1743 1742
 
1744 1743
 						if ($data[1] == 'top' || (is_numeric($data[1]) && $data[1] < 50))
1745 1744
 							$data[1] = '0 -2px 1px';
@@ -1901,7 +1900,8 @@  discard block
 block discarded – undo
1901 1900
 		{
1902 1901
 			if (isset($temp_bbc))
1903 1902
 				$bbc_codes = $temp_bbc;
1904
-			usort($codes, function ($a, $b) {
1903
+			usort($codes, function ($a, $b)
1904
+			{
1905 1905
 				return strcmp($a['tag'], $b['tag']);
1906 1906
 			});
1907 1907
 			return $codes;
@@ -2185,7 +2185,8 @@  discard block
 block discarded – undo
2185 2185
 						)?
2186 2186
 						';
2187 2187
 
2188
-						$data = preg_replace_callback('~' . $url_regex . '~xi' . ($context['utf8'] ? 'u' : ''), function ($matches) {
2188
+						$data = preg_replace_callback('~' . $url_regex . '~xi' . ($context['utf8'] ? 'u' : ''), function ($matches)
2189
+						{
2189 2190
 							$url = array_shift($matches);
2190 2191
 
2191 2192
 							// If this isn't a clean URL, bail out
@@ -2274,7 +2275,9 @@  discard block
 block discarded – undo
2274 2275
 			$look_for = strtolower(substr($message, $pos + 2, $pos2 - $pos - 2));
2275 2276
 
2276 2277
 			// A closing tag that doesn't match any open tags? Skip it.
2277
-			if (!in_array($look_for, array_map(function($code){return $code['tag'];}, $open_tags)))
2278
+			if (!in_array($look_for, array_map(function($code)
2279
+			{
2280
+return $code['tag'];}, $open_tags)))
2278 2281
 				continue;
2279 2282
 
2280 2283
 			$to_close = array();
@@ -3759,7 +3762,6 @@  discard block
 block discarded – undo
3759 3762
 				if (!isset($minSeed) && isset($js_file['options']['seed']))
3760 3763
 					$minSeed = $js_file['options']['seed'];
3761 3764
 			}
3762
-
3763 3765
 			else
3764 3766
 				echo '
3765 3767
 	<script src="', $js_file['fileUrl'], '"', !empty($js_file['options']['async']) ? ' async' : '', !empty($js_file['options']['defer']) ? ' defer' : '', '></script>';
@@ -3909,7 +3911,9 @@  discard block
 block discarded – undo
3909 3911
 		return $data;
3910 3912
 
3911 3913
 	// Different pages include different files, so we use a hash to label the different combinations
3912
-	$hash = md5(implode(' ', array_map(function($file) { return $file['filePath'] . (int) @filesize($file['filePath']) . (int) @filemtime($file['filePath']); }, $data)));
3914
+	$hash = md5(implode(' ', array_map(function($file)
3915
+	{
3916
+return $file['filePath'] . (int) @filesize($file['filePath']) . (int) @filemtime($file['filePath']); }, $data)));
3913 3917
 
3914 3918
 	// Is this a deferred or asynchonous JavaScript file?
3915 3919
 	$async = $type === 'js';
@@ -5907,7 +5911,6 @@  discard block
 block discarded – undo
5907 5911
 			$isWritable = true;
5908 5912
 			break;
5909 5913
 		}
5910
-
5911 5914
 		else
5912 5915
 			@chmod($file, $val);
5913 5916
 	}
@@ -6077,7 +6080,8 @@  discard block
 block discarded – undo
6077 6080
 	if (!empty($tlds))
6078 6081
 	{
6079 6082
 		// Clean $tlds and convert it to an array
6080
-		$tlds = array_filter(explode("\n", strtolower($tlds)), function($line) {
6083
+		$tlds = array_filter(explode("\n", strtolower($tlds)), function($line)
6084
+		{
6081 6085
 			$line = trim($line);
6082 6086
 			if (empty($line) || strpos($line, '#') !== false || strpos($line, ' ') !== false)
6083 6087
 				return false;
@@ -6088,7 +6092,9 @@  discard block
 block discarded – undo
6088 6092
 		// Convert Punycode to Unicode
6089 6093
 		require_once($sourcedir . '/Class-Punycode.php');
6090 6094
 		$Punycode = new Punycode();
6091
-		$tlds = array_map(function ($input) use ($Punycode) { return $Punycode->decode($input); }, $tlds);
6095
+		$tlds = array_map(function ($input) use ($Punycode)
6096
+		{
6097
+return $Punycode->decode($input); }, $tlds);
6092 6098
 	}
6093 6099
 	// Otherwise, use the 2012 list of gTLDs and ccTLDs for now and schedule a background update
6094 6100
 	else
@@ -6255,7 +6261,8 @@  discard block
 block discarded – undo
6255 6261
 		}
6256 6262
 
6257 6263
 		// Sort by key length and then alphabetically
6258
-		uksort($regex, function($k1, $k2) use (&$strlen) {
6264
+		uksort($regex, function($k1, $k2) use (&$strlen)
6265
+		{
6259 6266
 			$l1 = $strlen($k1);
6260 6267
 			$l2 = $strlen($k2);
6261 6268
 
@@ -6509,7 +6516,8 @@  discard block
 block discarded – undo
6509 6516
 function sanitize_iri($iri)
6510 6517
 {
6511 6518
 	// Encode any non-ASCII characters (but not space or control characters of any sort)
6512
-	$iri = preg_replace_callback('~[^\x00-\x7F\pZ\pC]~u', function ($matches) {
6519
+	$iri = preg_replace_callback('~[^\x00-\x7F\pZ\pC]~u', function ($matches)
6520
+	{
6513 6521
 		return rawurlencode($matches[0]);
6514 6522
 	}, $iri);
6515 6523
 
Please login to merge, or discard this patch.
Sources/QueryString.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -440,7 +440,8 @@
 block discarded – undo
440 440
 		$ip_address = inet_pton($ip_address);
441 441
 		$cidr_network = inet_pton($cidr_network);
442 442
 		$binMask = str_repeat("f", $cidr_subnetmask / 4);
443
-		switch ($cidr_subnetmask % 4) {
443
+		switch ($cidr_subnetmask % 4)
444
+		{
444 445
 		  case 0:
445 446
 			break;
446 447
 		  case 1:
Please login to merge, or discard this patch.
Sources/Themes.php 1 patch
Braces   -1 removed lines patch added patch discarded remove patch
@@ -1364,7 +1364,6 @@
 block discarded – undo
1364 1364
 		// return all the info.
1365 1365
 		return $context['to_install'];
1366 1366
 	}
1367
-
1368 1367
 	else
1369 1368
 		fatal_lang_error('theme_install_error_title', false);
1370 1369
 }
Please login to merge, or discard this patch.
Sources/ManageMaintenance.php 1 patch
Braces   -1 removed lines patch added patch discarded remove patch
@@ -2291,7 +2291,6 @@
 block discarded – undo
2291 2291
 		list ($hookData['class'], $hookData['method']) = explode('::', $modFunc);
2292 2292
 		$hookData['pureFunc'] = $hookData['method'];
2293 2293
 	}
2294
-
2295 2294
 	else
2296 2295
 		$hookData['pureFunc'] = $modFunc;
2297 2296
 
Please login to merge, or discard this patch.
Sources/Register.php 1 patch
Braces   -1 removed lines patch added patch discarded remove patch
@@ -849,7 +849,6 @@
 block discarded – undo
849 849
 			die("\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x21\xF9\x04\x01\x00\x00\x00\x00\x2C\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3B");
850 850
 		}
851 851
 	}
852
-
853 852
 	elseif ($_REQUEST['format'] === '.wav')
854 853
 	{
855 854
 		require_once($sourcedir . '/Subs-Sound.php');
Please login to merge, or discard this patch.
Sources/Subs-Package.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -253,9 +253,10 @@  discard block
 block discarded – undo
253 253
 
254 254
 		// Phar doesn't handle open_basedir restrictions very well and throws a PHP Warning. Ignore that.
255 255
 		set_error_handler(function($errno, $errstr, $errfile, $errline)
256
-			{
256
+		{
257 257
 				// error was suppressed with the @-operator
258
-				if (0 === error_reporting()) {
258
+				if (0 === error_reporting())
259
+				{
259 260
 					return false;
260 261
 				}
261 262
 				if (strpos($errstr, 'PharData::__construct(): open_basedir') === false)
@@ -269,7 +270,7 @@  discard block
 block discarded – undo
269 270
 
270 271
 		// go though each file in the archive
271 272
 		foreach ($iterator as $file_info)
272
-			{
273
+		{
273 274
 				$i = $iterator->getSubPathname();
274 275
 				// If this is a file, and it doesn't exist.... happy days!
275 276
 				if (substr($i, -1) != '/' && !file_exists($destination . '/' . $i))
Please login to merge, or discard this patch.
Sources/Subs-BoardIndex.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -419,7 +419,7 @@
 block discarded – undo
419 419
 					$board['last_post']['last_post_message'] = sprintf($txt['last_post_message'], $board['last_post']['member']['link'], $board['last_post']['link'], $board['last_post']['time'] > 0 ? timeformat($board['last_post']['time']) : $txt['not_applicable']);
420 420
 			}
421 421
 		}
422
-	else
422
+		else
423 423
 		foreach ($this_category as &$board )
424 424
 		{
425 425
 			if (!empty($moderators[$board['id']]))
Please login to merge, or discard this patch.