Passed
Pull Request — release-2.1 (#6171)
by Mathias
04:49
created
Sources/MessageIndex.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -330,7 +330,7 @@
 block discarded – undo
330 330
 		WHERE t.id_board = {int:current_board} '
331 331
 			. (!$modSettings['postmod_active'] || $context['can_approve_posts'] ? '' : '
332 332
 			AND (t.approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR t.id_member_started = {int:current_member}') . ')') . (!empty($message_index_topic_wheres) ? ' 
333
-			AND ' . implode("\n\t\t\t\tAND ", $message_index_topic_wheres) : ''). '
333
+			AND ' . implode("\n\t\t\t\tAND ", $message_index_topic_wheres) : '') . '
334 334
 		ORDER BY is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' . $_REQUEST['sort'] . ($ascending ? '' : ' DESC') . '
335 335
 		LIMIT {int:maxindex}
336 336
 			OFFSET {int:start} ';
Please login to merge, or discard this patch.
Themes/default/Admin.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -756,7 +756,7 @@
 block discarded – undo
756 756
 	}
757 757
 
758 758
 	// Filter out any redundant separators before we start the loop
759
-	$context['config_vars'] = array_filter($context['config_vars'], function ($v) use ($context)
759
+	$context['config_vars'] = array_filter($context['config_vars'], function($v) use ($context)
760 760
 		{
761 761
 			static $config_vars, $prev;
762 762
 
Please login to merge, or discard this patch.
Themes/default/index.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -574,7 +574,7 @@
 block discarded – undo
574 574
 				$value['id'] = $key;
575 575
 
576 576
 			$button = '
577
-				<a class="button button_strip_' . $key . (!empty($value['active']) ? ' active' : '') . (isset($value['class']) ? ' ' . $value['class'] : '') . '" ' . (!empty($value['url']) ? 'href="' . $value['url'] . '"' : '') . ' ' . (isset($value['custom']) ? ' ' . $value['custom'] : '') . '>'.(!empty($value['icon']) ? '<span class="main_icons '.$value['icon'].'"></span>' : '').'' . $txt[$value['text']] . '</a>';
577
+				<a class="button button_strip_' . $key . (!empty($value['active']) ? ' active' : '') . (isset($value['class']) ? ' ' . $value['class'] : '') . '" ' . (!empty($value['url']) ? 'href="' . $value['url'] . '"' : '') . ' ' . (isset($value['custom']) ? ' ' . $value['custom'] : '') . '>' . (!empty($value['icon']) ? '<span class="main_icons ' . $value['icon'] . '"></span>' : '') . '' . $txt[$value['text']] . '</a>';
578 578
 
579 579
 			if (!empty($value['sub_buttons']))
580 580
 			{
Please login to merge, or discard this patch.
Themes/default/PersonalMessage.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1931,7 +1931,7 @@
 block discarded – undo
1931 1931
 				<div class="floatright smalltext righttext">
1932 1932
 					<div class="recipient_to">&#171;&nbsp;<strong>', $txt['to'], ':</strong> ', implode(', ', $draft['recipients']['to']), '&nbsp;&#187;</div>';
1933 1933
 
1934
-			if(!empty($draft['recipients']['bcc']))
1934
+			if (!empty($draft['recipients']['bcc']))
1935 1935
 				echo'
1936 1936
 					<div class="pm_bbc">&#171;&nbsp;<strong>', $txt['pm_bcc'], ':</strong> ', implode(', ', $draft['recipients']['bcc']), '&nbsp;&#187;</div>';
1937 1937
 
Please login to merge, or discard this patch.
Sources/Post.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1241,7 +1241,7 @@
 block discarded – undo
1241 1241
 	// File Upload.
1242 1242
 	if ($context['can_post_attachment'])
1243 1243
 	{
1244
-		$acceptedFiles = empty($context['allowed_extensions']) ? '' : implode(',', array_map(function ($val) use ($smcFunc)
1244
+		$acceptedFiles = empty($context['allowed_extensions']) ? '' : implode(',', array_map(function($val) use ($smcFunc)
1245 1245
 		{
1246 1246
 			return !empty($val) ? ('.' . $smcFunc['htmltrim']($val)) : '';
1247 1247
 		}, explode(',', $context['allowed_extensions'])));
Please login to merge, or discard this patch.
Sources/Subs-Db-postgresql.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 		display_db_error();
74 74
 
75 75
 	// We need to escape ' and \
76
-	$db_passwd = str_replace(array('\\','\''), array('\\\\','\\\''), $db_passwd);
76
+	$db_passwd = str_replace(array('\\', '\''), array('\\\\', '\\\''), $db_passwd);
77 77
 
78 78
 	if (!empty($db_options['persist']))
79 79
 		$connection = @pg_pconnect((empty($db_server) ? '' : 'host=' . $db_server . ' ') . 'dbname=' . $db_name . ' user=\'' . $db_user . '\' password=\'' . $db_passwd . '\'' . (empty($db_options['port']) ? '' : ' port=\'' . $db_options['port'] . '\''));
@@ -925,7 +925,7 @@  discard block
 block discarded – undo
925 925
 	if (filter_var($error_array[2], FILTER_VALIDATE_IP) === false)
926 926
 		$error_array[2] = null;
927 927
 
928
-	if(empty($db_persist))
928
+	if (empty($db_persist))
929 929
 	{ // without pooling
930 930
 		if (empty($pg_error_data_prep))
931 931
 			$pg_error_data_prep = pg_prepare($db_connection, 'smf_log_errors',
Please login to merge, or discard this patch.
Sources/Subs-Admin.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1683,7 +1683,7 @@  discard block
 block discarded – undo
1683 1683
 	// Prevents warnings about constants that are already defined.
1684 1684
 	$settingsText = preg_replace_callback(
1685 1685
 		'~\bdefine\s*\(\s*(["\'])(\w+)\1~',
1686
-		function ($matches)
1686
+		function($matches)
1687 1687
 		{
1688 1688
 			return 'define(\'' . md5(mt_rand()) . '\'';
1689 1689
 		},
@@ -1693,7 +1693,7 @@  discard block
 block discarded – undo
1693 1693
 	// Handle eval errors gracefully in both PHP 5 and PHP 7
1694 1694
 	try
1695 1695
 	{
1696
-		if($settingsText !== '' && @eval($settingsText) === false)
1696
+		if ($settingsText !== '' && @eval($settingsText) === false)
1697 1697
 			throw new ErrorException('eval error');
1698 1698
 
1699 1699
 		unset($mtime, $settingsFile, $settingsText);
@@ -1900,7 +1900,7 @@  discard block
 block discarded – undo
1900 1900
 	}
1901 1901
 
1902 1902
 	// Everything is simpler if we convert heredocs to normal strings first.
1903
-	if (preg_match_all('/<<<(\'?)(\w+)\'?'. $line_ending . '(.*?)'. $line_ending . '\2;$/m', $code_str, $matches))
1903
+	if (preg_match_all('/<<<(\'?)(\w+)\'?' . $line_ending . '(.*?)' . $line_ending . '\2;$/m', $code_str, $matches))
1904 1904
 	{
1905 1905
 		foreach ($matches[0] as $mkey => $heredoc)
1906 1906
 		{
@@ -1914,7 +1914,7 @@  discard block
 block discarded – undo
1914 1914
 	}
1915 1915
 
1916 1916
 	// Split before everything that could possibly delimit a comment or a string.
1917
-	$parts = preg_split('~(?=#+|/(?=/|\*)|\*/|'. $line_ending . '|(?<!\\\)[\'"])~m', $code_str);
1917
+	$parts = preg_split('~(?=#+|/(?=/|\*)|\*/|' . $line_ending . '|(?<!\\\)[\'"])~m', $code_str);
1918 1918
 
1919 1919
 	$in_string = 0;
1920 1920
 	$in_comment = 0;
Please login to merge, or discard this patch.
Sources/Notify.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -282,7 +282,7 @@
 block discarded – undo
282 282
 				'{db_prefix}log_notify',
283 283
 				array('id_member' => 'int', 'id_topic' => 'int', 'id_board' => 'int'),
284 284
 				array($user_info['id'], $log['id_topic'], 0),
285
-				array('id_member','id_topic', 'id_board')
285
+				array('id_member', 'id_topic', 'id_board')
286 286
 			);
287 287
 		}
288 288
 		else
Please login to merge, or discard this patch.
Sources/tasks/CreatePost-Notify.php 1 patch
Spacing   +3 added lines, -5 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 		if ($type == 'edit')
119 119
 		{
120 120
 			// Filter out members who have already been notified about this post's topic
121
-			$unnotified = array_filter($watched, function ($member)
121
+			$unnotified = array_filter($watched, function($member)
122 122
 			{
123 123
 				return empty($member['sent']);
124 124
 			});
@@ -204,8 +204,7 @@  discard block
 block discarded – undo
204 204
 			if (!empty($member_data['id_topic']) && $type != 'topic' && !empty($prefs[$member_id]))
205 205
 			{
206 206
 				$pref = !empty($prefs[$member_id]['topic_notify_' . $topicOptions['id']]) ?
207
-					$prefs[$member_id]['topic_notify_' . $topicOptions['id']] :
208
-					(!empty($prefs[$member_id]['topic_notify']) ? $prefs[$member_id]['topic_notify'] : 0);
207
+					$prefs[$member_id]['topic_notify_' . $topicOptions['id']] : (!empty($prefs[$member_id]['topic_notify']) ? $prefs[$member_id]['topic_notify'] : 0);
209 208
 
210 209
 				$message_type = 'notification_' . $type;
211 210
 
@@ -224,8 +223,7 @@  discard block
 block discarded – undo
224 223
 			elseif ($type == 'topic')
225 224
 			{
226 225
 				$pref = !empty($prefs[$member_id]['board_notify_' . $topicOptions['board']]) ?
227
-					$prefs[$member_id]['board_notify_' . $topicOptions['board']] :
228
-					(!empty($prefs[$member_id]['board_notify']) ? $prefs[$member_id]['board_notify'] : 0);
226
+					$prefs[$member_id]['board_notify_' . $topicOptions['board']] : (!empty($prefs[$member_id]['board_notify']) ? $prefs[$member_id]['board_notify'] : 0);
229 227
 
230 228
 				$content_type = 'board';
231 229
 
Please login to merge, or discard this patch.