Passed
Pull Request — release-2.1 (#6262)
by Jeremy
05:04
created
Sources/Subs-Admin.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
 				'if (!is_dir(realpath($cachedir)) && is_dir($boarddir . \'/cache\'))',
847 847
 				'	$cachedir = $boarddir . \'/cache\';',
848 848
 			)),
849
-			'search_pattern' => '~\n?(#[^\n]+)?(?:\n\h*if\s*\((?:\!file_exists\(\$(?'.'>boarddir|sourcedir|tasksdir|packagesdir|cachedir)\)|\!is_dir\(realpath\(\$(?'.'>boarddir|sourcedir|tasksdir|packagesdir|cachedir)\)\))[^;]+\n\h*\$(?'.'>boarddir|sourcedir|tasksdir|packagesdir|cachedir)[^\n]+;)+~sm',
849
+			'search_pattern' => '~\n?(#[^\n]+)?(?:\n\h*if\s*\((?:\!file_exists\(\$(?' . '>boarddir|sourcedir|tasksdir|packagesdir|cachedir)\)|\!is_dir\(realpath\(\$(?' . '>boarddir|sourcedir|tasksdir|packagesdir|cachedir)\)\))[^;]+\n\h*\$(?' . '>boarddir|sourcedir|tasksdir|packagesdir|cachedir)[^\n]+;)+~sm',
850 850
 		),
851 851
 		'db_character_set' => array(
852 852
 			'text' => implode("\n", array(
@@ -945,8 +945,8 @@  discard block
 block discarded – undo
945 945
 		'boolean' =>  '(?i:TRUE|FALSE|(["\']?)[01]\b\\1)',
946 946
 		'NULL' =>  '(?i:NULL)',
947 947
 		// These use a PCRE subroutine to match nested arrays.
948
-		'array' =>  'array\s*(\((?'.'>[^()]|(?1))*\))',
949
-		'object' =>  '\w+::__set_state\(array\s*(\((?'.'>[^()]|(?1))*\))\)',
948
+		'array' =>  'array\s*(\((?' . '>[^()]|(?1))*\))',
949
+		'object' =>  '\w+::__set_state\(array\s*(\((?' . '>[^()]|(?1))*\))\)',
950 950
 	);
951 951
 
952 952
 	/*
@@ -979,7 +979,7 @@  discard block
 block discarded – undo
979 979
 		),
980 980
 		// Remove the code that redirects to the installer.
981 981
 		$neg_index-- => array(
982
-			'search_pattern' => '~^if\s*\(file_exists\(dirname\(__FILE__\)\s*\.\s*\'/install\.php\'\)\)\s*(?:({(?'.'>[^{}]|(?1))*})\h*|header(\((?' . '>[^()]|(?2))*\));\n)~m',
982
+			'search_pattern' => '~^if\s*\(file_exists\(dirname\(__FILE__\)\s*\.\s*\'/install\.php\'\)\)\s*(?:({(?' . '>[^{}]|(?1))*})\h*|header(\((?' . '>[^()]|(?2))*\));\n)~m',
983 983
 			'placeholder' => '',
984 984
 		),
985 985
 	);
@@ -1742,7 +1742,7 @@  discard block
 block discarded – undo
1742 1742
 	// Prevents warnings about constants that are already defined.
1743 1743
 	$settingsText = preg_replace_callback(
1744 1744
 		'~\bdefine\s*\(\s*(["\'])(\w+)\1~',
1745
-		function ($matches)
1745
+		function($matches)
1746 1746
 		{
1747 1747
 			return 'define(\'' . md5(mt_rand()) . '\'';
1748 1748
 		},
@@ -1752,7 +1752,7 @@  discard block
 block discarded – undo
1752 1752
 	// Handle eval errors gracefully in both PHP 5 and PHP 7
1753 1753
 	try
1754 1754
 	{
1755
-		if($settingsText !== '' && @eval($settingsText) === false)
1755
+		if ($settingsText !== '' && @eval($settingsText) === false)
1756 1756
 			throw new ErrorException('eval error');
1757 1757
 
1758 1758
 		unset($mtime, $settingsFile, $settingsText);
@@ -1955,7 +1955,7 @@  discard block
 block discarded – undo
1955 1955
 	}
1956 1956
 
1957 1957
 	// Everything is simpler if we convert heredocs to normal strings first.
1958
-	if (preg_match_all('/<<<(\'?)(\w+)\'?'. $line_ending . '(.*?)'. $line_ending . '\2;$/m', $code_str, $matches))
1958
+	if (preg_match_all('/<<<(\'?)(\w+)\'?' . $line_ending . '(.*?)' . $line_ending . '\2;$/m', $code_str, $matches))
1959 1959
 	{
1960 1960
 		foreach ($matches[0] as $mkey => $heredoc)
1961 1961
 		{
@@ -1969,7 +1969,7 @@  discard block
 block discarded – undo
1969 1969
 	}
1970 1970
 
1971 1971
 	// Split before everything that could possibly delimit a comment or a string.
1972
-	$parts = preg_split('~(?=#+|/(?=/|\*)|\*/|'. $line_ending . '|(?<!\\\)[\'"])~m', $code_str);
1972
+	$parts = preg_split('~(?=#+|/(?=/|\*)|\*/|' . $line_ending . '|(?<!\\\)[\'"])~m', $code_str);
1973 1973
 
1974 1974
 	$in_string = 0;
1975 1975
 	$in_comment = 0;
Please login to merge, or discard this patch.
Sources/Load.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3862,7 +3862,7 @@
 block discarded – undo
3862 3862
 			$auth_secret = hash_file('sha256', $boarddir . '/Settings.php');
3863 3863
 
3864 3864
 			// Set the last error to now, but only every 15 minutes.  Don't need to flood the logs.
3865
-			if (empty($db_last_error) || ($db_last_error + 60*15) <= time())
3865
+			if (empty($db_last_error) || ($db_last_error + 60 * 15) <= time())
3866 3866
 			{
3867 3867
 				updateDbLastError(time());
3868 3868
 				loadLanguage('Errors');
Please login to merge, or discard this patch.