Passed
Pull Request — release-2.1 (#6531)
by Michael
04:20
created
Sources/tasks/ExportProfileData.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 
153 153
 		$feed_meta = array(
154 154
 			'title' => sprintf($txt['profile_of_username'], $user_profile[$uid]['real_name']),
155
-			'desc' => sentence_list(array_map(function ($datatype) use ($txt) { return $txt[$datatype]; }, array_keys($included))),
155
+			'desc' => sentence_list(array_map(function($datatype) use ($txt) { return $txt[$datatype]; }, array_keys($included))),
156 156
 			'author' => $mbname,
157 157
 			'source' => $scripturl . '?action=profile;u=' . $uid,
158 158
 			'self' => '', // Unused, but can't be null.
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
 					'src' => 'src="' . $currentAttachment['href'] . '" onerror="$(\'.dlattach_' . $currentAttachment['id'] . '\').show(); $(\'.dlattach_' . $currentAttachment['id'] . '\').css({\'position\': \'absolute\'});"',
641 641
 				),
642 642
 				$returnContext
643
-			) . $hidden_orig_link . '</span>' ;
643
+			) . $hidden_orig_link . '</span>';
644 644
 		}
645 645
 		elseif (strpos($currentAttachment['mime_type'], 'video/') === 0)
646 646
 		{
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -152,7 +152,9 @@
 block discarded – undo
152 152
 
153 153
 		$feed_meta = array(
154 154
 			'title' => sprintf($txt['profile_of_username'], $user_profile[$uid]['real_name']),
155
-			'desc' => sentence_list(array_map(function ($datatype) use ($txt) { return $txt[$datatype]; }, array_keys($included))),
155
+			'desc' => sentence_list(array_map(function ($datatype) use ($txt)
156
+			{
157
+return $txt[$datatype]; }, array_keys($included))),
156 158
 			'author' => $mbname,
157 159
 			'source' => $scripturl . '?action=profile;u=' . $uid,
158 160
 			'self' => '', // Unused, but can't be null.
Please login to merge, or discard this patch.
Sources/Drafts.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -644,13 +644,13 @@  discard block
 block discarded – undo
644 644
 			'quickbuttons' => array(
645 645
 				'edit' => array(
646 646
 					'label' => $txt['draft_edit'],
647
-					'href' => $scripturl.'?action=post;'.(empty($row['id_topic']) ? 'board='.$row['id_board'] : 'topic='.$row['id_topic']).'.0;id_draft='.$row['id_draft'],
647
+					'href' => $scripturl . '?action=post;' . (empty($row['id_topic']) ? 'board=' . $row['id_board'] : 'topic=' . $row['id_topic']) . '.0;id_draft=' . $row['id_draft'],
648 648
 					'icon' => 'modify_button'
649 649
 				),
650 650
 				'delete' => array(
651 651
 					'label' => $txt['draft_delete'],
652
-					'href' => $scripturl.'?action=profile;u='.$context['member']['id'].';area=showdrafts;delete='.$row['id_draft'].';'.$context['session_var'].'='.$context['session_id'],
653
-					'javascript' => 'data-confirm="'.$txt['draft_remove'].'"',
652
+					'href' => $scripturl . '?action=profile;u=' . $context['member']['id'] . ';area=showdrafts;delete=' . $row['id_draft'] . ';' . $context['session_var'] . '=' . $context['session_id'],
653
+					'javascript' => 'data-confirm="' . $txt['draft_remove'] . '"',
654 654
 					'class' => 'you_sure',
655 655
 					'icon' => 'remove_button'
656 656
 				),
@@ -837,13 +837,13 @@  discard block
 block discarded – undo
837 837
 			'quickbuttons' => array(
838 838
 				'edit' => array(
839 839
 					'label' => $txt['draft_edit'],
840
-					'href' => $scripturl.'?action=pm;sa=showpmdrafts;id_draft='.$row['id_draft'].';'.$context['session_var'].'='.$context['session_id'],
840
+					'href' => $scripturl . '?action=pm;sa=showpmdrafts;id_draft=' . $row['id_draft'] . ';' . $context['session_var'] . '=' . $context['session_id'],
841 841
 					'icon' => 'modify_button'
842 842
 				),
843 843
 				'delete' => array(
844 844
 					'label' => $txt['draft_delete'],
845
-					'href' => $scripturl.'?action=pm;sa=showpmdrafts;delete='.$row['id_draft'].';'.$context['session_var'].'='.$context['session_id'],
846
-					'javascript' => 'data-confirm="'.$txt['draft_remove'].'?"',
845
+					'href' => $scripturl . '?action=pm;sa=showpmdrafts;delete=' . $row['id_draft'] . ';' . $context['session_var'] . '=' . $context['session_id'],
846
+					'javascript' => 'data-confirm="' . $txt['draft_remove'] . '?"',
847 847
 					'class' => 'you_sure',
848 848
 					'icon' => 'remove_button'
849 849
 				),
Please login to merge, or discard this patch.
Sources/Cache/APIs/FileBased.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 		$class_name = $this->getImplementationClassKeyName();
185 185
 		$class_name_txt_key = strtolower($class_name);
186 186
 
187
-		$config_vars[] = $txt['cache_'. $class_name_txt_key .'_settings'];
187
+		$config_vars[] = $txt['cache_' . $class_name_txt_key . '_settings'];
188 188
 		$config_vars[] = array('cachedir', $txt['cachedir'], 'file', 'text', 36, 'cache_cachedir');
189 189
 
190 190
 		if (!isset($context['settings_post_javascript']))
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 		$context['settings_post_javascript'] .= '
194 194
 			$("#cache_accelerator").change(function (e) {
195 195
 				var cache_type = e.currentTarget.value;
196
-				$("#cachedir").prop("disabled", cache_type != "'. $class_name .'");
196
+				$("#cachedir").prop("disabled", cache_type != "'. $class_name . '");
197 197
 			});';
198 198
 	}
199 199
 
Please login to merge, or discard this patch.
Sources/ManageServer.php 2 patches
Braces   -1 removed lines patch added patch discarded remove patch
@@ -707,7 +707,6 @@
 block discarded – undo
707 707
 		$cache_level = array($txt['cache_off']);
708 708
 		$apis_names['none'] = $txt['cache_off'];
709 709
 	}
710
-
711 710
 	else
712 711
 	{
713 712
 		$txt['cache_settings_message'] = '<strong class="success">' .
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1638,7 +1638,7 @@
 block discarded – undo
1638 1638
 	$cacheAPIdir = $sourcedir . '/Cache';
1639 1639
 
1640 1640
 	$loadedApis = array();
1641
-	$apis_dir = $cacheAPIdir .'/'. CacheApi::APIS_FOLDER;
1641
+	$apis_dir = $cacheAPIdir . '/' . CacheApi::APIS_FOLDER;
1642 1642
 
1643 1643
 	$api_classes = new GlobIterator($apis_dir . '/*.php', FilesystemIterator::NEW_CURRENT_AND_KEY);
1644 1644
 
Please login to merge, or discard this patch.
Sources/Cache/APIs/Sqlite.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -131,14 +131,14 @@  discard block
 block discarded – undo
131 131
 		$class_name = $this->getImplementationClassKeyName();
132 132
 		$class_name_txt_key = strtolower($class_name);
133 133
 
134
-		$config_vars[] = $txt['cache_'. $class_name_txt_key .'_settings'];
134
+		$config_vars[] = $txt['cache_' . $class_name_txt_key . '_settings'];
135 135
 		$config_vars[] = array(
136
-			'cachedir_'. $class_name_txt_key,
137
-			$txt['cachedir_'. $class_name_txt_key],
136
+			'cachedir_' . $class_name_txt_key,
137
+			$txt['cachedir_' . $class_name_txt_key],
138 138
 			'file',
139 139
 			'text',
140 140
 			36,
141
-			'cache_'. $class_name_txt_key .'_cachedir');
141
+			'cache_' . $class_name_txt_key . '_cachedir');
142 142
 
143 143
 		if (!isset($context['settings_post_javascript']))
144 144
 			$context['settings_post_javascript'] = '';
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 		$context['settings_post_javascript'] .= '
147 147
 			$("#cache_accelerator").change(function (e) {
148 148
 				var cache_type = e.currentTarget.value;
149
-				$("#cachedir_'. $class_name_txt_key .'").prop("disabled", cache_type != "'. $class_name .'");
149
+				$("#cachedir_'. $class_name_txt_key . '").prop("disabled", cache_type != "' . $class_name . '");
150 150
 			});';
151 151
 	}
152 152
 
Please login to merge, or discard this patch.
Sources/Help.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -163,7 +163,8 @@
 block discarded – undo
163 163
 	else
164 164
 		$context['help_text'] = $_GET['help'];
165 165
 
166
-	switch ($_GET['help']) {
166
+	switch ($_GET['help'])
167
+	{
167 168
 		case 'cal_short_months':
168 169
 			$context['help_text'] = sprintf($context['help_text'], $txt['months_short'][1], $txt['months_titles'][1]);
169 170
 			break;
Please login to merge, or discard this patch.
Sources/Load.php 2 patches
Braces   +1 added lines, -4 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 	// Set a list of common functions.
105 105
 	$ent_list = '&(?:#' . (empty($modSettings['disableEntityCheck']) ? '\d{1,7}' : '021') . '|quot|amp|lt|gt|nbsp);';
106 106
 	$ent_check = empty($modSettings['disableEntityCheck']) ? function($string)
107
-		{
107
+	{
108 108
 			$string = preg_replace_callback('~(&#(\d{1,7}|x[0-9a-fA-F]{1,6});)~', 'entity_fix__callback', $string);
109 109
 			return $string;
110 110
 		} : function($string)
@@ -929,7 +929,6 @@  discard block
 block discarded – undo
929 929
 			$user_info_min[$row['id_member']]['time_offset'] = ($tz_user->getOffset($time_user) -
930 930
 					$tz_system->getOffset($time_system)) / 3600;
931 931
 		}
932
-
933 932
 		else
934 933
 			$user_info_min[$row['id_member']]['time_offset'] = empty($row['time_offset']) ? 0 : $row['time_offset'];
935 934
 	}
@@ -1657,7 +1656,6 @@  discard block
 block discarded – undo
1657 1656
 			$time_user = new DateTime('now', $tz_user);
1658 1657
 			$profile['time_offset'] = ($tz_user->getOffset($time_user) - $tz_system->getOffset($time_system)) / 3600;
1659 1658
 		}
1660
-
1661 1659
 		else
1662 1660
 		{
1663 1661
 			// !!! Compatibility.
@@ -2322,7 +2320,6 @@  discard block
 block discarded – undo
2322 2320
 		loadLanguage('index+Modifications');
2323 2321
 		$context['template_layers'] = array();
2324 2322
 	}
2325
-
2326 2323
 	else
2327 2324
 	{
2328 2325
 		// Custom templates to load, or just default?
Please login to merge, or discard this patch.
Spacing   +6 added lines, -9 removed lines patch added patch discarded remove patch
@@ -814,7 +814,7 @@  discard block
 block discarded – undo
814 814
 			'filename' => empty($user_settings['filename']) ? '' : $user_settings['filename'],
815 815
 			'custom_dir' => !empty($user_settings['attachment_type']) && $user_settings['attachment_type'] == 1,
816 816
 			'id_attach' => isset($user_settings['id_attach']) ? $user_settings['id_attach'] : 0,
817
-			'width' => isset($user_settings['attachment_width']) > 0 ? $user_settings['attachment_width']: 0,
817
+			'width' => isset($user_settings['attachment_width']) > 0 ? $user_settings['attachment_width'] : 0,
818 818
 			'height' => isset($user_settings['attachment_height']) > 0 ? $user_settings['attachment_height'] : 0,
819 819
 		),
820 820
 		'smiley_set' => isset($user_settings['smiley_set']) ? $user_settings['smiley_set'] : '',
@@ -1755,7 +1755,7 @@  discard block
 block discarded – undo
1755 1755
 		if (!empty($image))
1756 1756
 			$memberContext[$user]['avatar'] = array(
1757 1757
 				'name' => $profile['avatar'],
1758
-				'image' => '<img class="avatar" src="' . $image . '" alt="" loading="lazy" width="' . $profile['attachment_width'] . '" height = "'. $profile['attachment_height'] . '">',
1758
+				'image' => '<img class="avatar" src="' . $image . '" alt="" loading="lazy" width="' . $profile['attachment_width'] . '" height = "' . $profile['attachment_height'] . '">',
1759 1759
 				'href' => $image,
1760 1760
 				'url' => $image,
1761 1761
 			);
@@ -2720,8 +2720,7 @@  discard block
 block discarded – undo
2720 2720
 		$context['css_files_order'] = array();
2721 2721
 
2722 2722
 	$params['seed'] = (!array_key_exists('seed', $params) || (array_key_exists('seed', $params) && $params['seed'] === true)) ?
2723
-		(array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') :
2724
-		(is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : '');
2723
+		(array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : '');
2725 2724
 	$params['force_current'] = isset($params['force_current']) ? $params['force_current'] : false;
2726 2725
 	$themeRef = !empty($params['default_theme']) ? 'default_theme' : 'theme';
2727 2726
 	$params['minimize'] = isset($params['minimize']) ? $params['minimize'] : true;
@@ -2835,8 +2834,7 @@  discard block
 block discarded – undo
2835 2834
 	global $settings, $context, $modSettings;
2836 2835
 
2837 2836
 	$params['seed'] = (!array_key_exists('seed', $params) || (array_key_exists('seed', $params) && $params['seed'] === true)) ?
2838
-		(array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') :
2839
-		(is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : '');
2837
+		(array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : '');
2840 2838
 	$params['force_current'] = isset($params['force_current']) ? $params['force_current'] : false;
2841 2839
 	$themeRef = !empty($params['default_theme']) ? 'default_theme' : 'theme';
2842 2840
 	$params['async'] = isset($params['async']) ? $params['async'] : false;
@@ -3579,8 +3577,7 @@  discard block
 block discarded – undo
3579 3577
 
3580 3578
 	// What accelerator we are going to try.
3581 3579
 	$cache_class_name = !empty($cache_accelerator) ? $cache_accelerator : CacheApi::APIS_DEFAULT;
3582
-	$fully_qualified_class_name = !empty($overrideCache) ? $overrideCache :
3583
-		CacheApi::APIS_NAMESPACE . $cache_class_name;
3580
+	$fully_qualified_class_name = !empty($overrideCache) ? $overrideCache : CacheApi::APIS_NAMESPACE . $cache_class_name;
3584 3581
 
3585 3582
 	// Do some basic tests.
3586 3583
 	if (class_exists($fully_qualified_class_name))
@@ -3884,7 +3881,7 @@  discard block
 block discarded – undo
3884 3881
 			$auth_secret = hash_file('sha256', $boarddir . '/Settings.php');
3885 3882
 
3886 3883
 			// Set the last error to now, but only every 15 minutes.  Don't need to flood the logs.
3887
-			if (empty($db_last_error) || ($db_last_error + 60*15) <= time())
3884
+			if (empty($db_last_error) || ($db_last_error + 60 * 15) <= time())
3888 3885
 			{
3889 3886
 				updateDbLastError(time());
3890 3887
 				loadLanguage('Errors');
Please login to merge, or discard this patch.
Themes/default/Profile.template.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1721,7 +1721,7 @@  discard block
 block discarded – undo
1721 1721
 		{
1722 1722
 			// Avoid double separators and empty titled sections
1723 1723
 			$empty_section = true;
1724
-			for ($j=$i+1; $j < count($context['theme_options']); $j++)
1724
+			for ($j = $i + 1; $j < count($context['theme_options']); $j++)
1725 1725
 			{
1726 1726
 				// Found another separator, so we're done
1727 1727
 				if (!is_array($context['theme_options'][$j]))
@@ -2700,8 +2700,7 @@  discard block
 block discarded – undo
2700 2700
 		foreach ($context['post_errors'] as $error)
2701 2701
 		{
2702 2702
 			$text_key_error = $error == 'password_short' ?
2703
-				sprintf($txt['profile_error_' . $error], (empty($modSettings['password_strength']) ? 4 : 8)) :
2704
-				$txt['profile_error_' . $error];
2703
+				sprintf($txt['profile_error_' . $error], (empty($modSettings['password_strength']) ? 4 : 8)) : $txt['profile_error_' . $error];
2705 2704
 
2706 2705
 			echo '
2707 2706
 				<li>', isset($txt['profile_error_' . $error]) ? $text_key_error : $error, '</li>';
Please login to merge, or discard this patch.
Sources/Subs-BoardIndex.php 2 patches
Braces   +1 added lines, -4 removed lines patch added patch discarded remove patch
@@ -280,7 +280,6 @@  discard block
 block discarded – undo
280 280
 					$this_category[$row_board['id_board']]['board_class'] = 'on';
281 281
 					$this_category[$row_board['id_board']]['board_tooltip'] = $txt['new_posts'];
282 282
 				}
283
-
284 283
 				else
285 284
 				{
286 285
 					$this_category[$row_board['id_board']]['board_tooltip'] = $txt['old_posts'];
@@ -415,7 +414,6 @@  discard block
 block discarded – undo
415 414
 			$this_last_post['href'] = $scripturl . '?topic=' . $row_board['id_topic'] . '.msg' . ($user_info['is_guest'] ? $row_board['id_msg'] : $row_board['new_from']) . (empty($row_board['is_read']) ? ';boardseen' : '') . '#new';
416 415
 			$this_last_post['link'] = '<a href="' . $this_last_post['href'] . '" title="' . $row_board['subject'] . '">' . $row_board['short_subject'] . '</a>';
417 416
 		}
418
-
419 417
 		else
420 418
 		{
421 419
 			$this_last_post['href'] = '';
@@ -510,8 +508,7 @@  discard block
 block discarded – undo
510 508
 					$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']);
511 509
 			}
512 510
 		}
513
-
514
-	else
511
+		else
515 512
 		foreach ($this_category as &$board)
516 513
 		{
517 514
 			if (isset($boards_parsed_data_by_cat_id[$board['id_cat']][$board['id']]))
Please login to merge, or discard this patch.
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -195,8 +195,7 @@
 block discarded – undo
195 195
 				);
196 196
 
197 197
 				$categories[$row_board['id_cat']]['link'] = '<a id="c' . $row_board['id_cat'] . '"></a>' . (!$context['user']['is_guest'] ?
198
-						'<a href="' . $scripturl . '?action=unread;c=' . $row_board['id_cat'] . '" title="' . sprintf($txt['new_posts_in_category'], $row_board['cat_name']) . '">' . $row_board['cat_name'] . '</a>' :
199
-						$row_board['cat_name']);
198
+						'<a href="' . $scripturl . '?action=unread;c=' . $row_board['id_cat'] . '" title="' . sprintf($txt['new_posts_in_category'], $row_board['cat_name']) . '">' . $row_board['cat_name'] . '</a>' : $row_board['cat_name']);
200 199
 
201 200
 			}
202 201
 
Please login to merge, or discard this patch.