Passed
Pull Request — release-2.1 (#4892)
by Mathias
06:02 queued 01:17
created
Sources/Profile-Actions.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1050,15 +1050,15 @@
 block discarded – undo
1050 1050
 }
1051 1051
 
1052 1052
 /**
1053
-  * Formats a line (passed as a fields  array) as CSV and returns the CSV as a string.
1054
-  * from https://stackoverflow.com/questions/3933668/convert-array-into-csv
1053
+ * Formats a line (passed as a fields  array) as CSV and returns the CSV as a string.
1054
+ * from https://stackoverflow.com/questions/3933668/convert-array-into-csv
1055 1055
  * 
1056 1056
  * @param array $fields a line of the array
1057 1057
  * @param string @delimiter the delimiter char
1058 1058
  * @param string @enclosure the enclosure char
1059 1059
  * @param boolean $encloseAll enclose all
1060 1060
  * @param boolean $nullToMysqlNull
1061
-  */
1061
+ */
1062 1062
 function arrayToCsv( array $fields, $delimiter = ';', $enclosure = '"', $encloseAll = false, $nullToMysqlNull = false ) {
1063 1063
 	$delimiter_esc = preg_quote($delimiter, '/');
1064 1064
 	$enclosure_esc = preg_quote($enclosure, '/');
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -992,12 +992,12 @@  discard block
 block discarded – undo
992 992
 	{
993 993
 		loadMemberData($memID, false, 'profile');
994 994
 		$profile = $user_profile[$memID];
995
-		$removeFields = array('secret_question','tfa_secret','password_salt');
995
+		$removeFields = array('secret_question', 'tfa_secret', 'password_salt');
996 996
 		foreach ($removeFields as $value)
997 997
 		{
998 998
 			unset($profile[$value]);
999 999
 		}
1000
-		foreach($profile as $key => &$value)
1000
+		foreach ($profile as $key => &$value)
1001 1001
 		{
1002 1002
 			if (is_array($value))
1003 1003
 				$value = $smcFunc['json_encode']($value);
@@ -1009,7 +1009,7 @@  discard block
 block discarded – undo
1009 1009
 	elseif ($mode == 'messages') // messages
1010 1010
 	{
1011 1011
 		
1012
-		$request = $smcFunc['db_query']('','
1012
+		$request = $smcFunc['db_query']('', '
1013 1013
 			SELECT id_msg, id_topic, poster_time, subject, modified_time, modified_name, modified_reason, body, likes, poster_ip
1014 1014
 			FROM {db_prefix}messages 
1015 1015
 			WHERE id_member = {int:memID}',
@@ -1027,7 +1027,7 @@  discard block
 block discarded – undo
1027 1027
 	}
1028 1028
 	elseif ($mode == 'pmessages')
1029 1029
 	{
1030
-		$request = $smcFunc['db_query']('','
1030
+		$request = $smcFunc['db_query']('', '
1031 1031
 			SELECT pm.msgtime, pm.subject, pm.body
1032 1032
 			FROM {db_prefix}personal_messages pm
1033 1033
 			LEFT JOIN {db_prefix}pm_recipients pmr on (pm.id_pm = pmr.id_pm and pmr.id_member = {int:memID})
@@ -1045,14 +1045,14 @@  discard block
 block discarded – undo
1045 1045
 	}
1046 1046
 	$count = count($profileData);
1047 1047
 	$csv_data = '';
1048
-	for($i = 0; $i < $count; $i++)
1048
+	for ($i = 0; $i < $count; $i++)
1049 1049
 	{
1050 1050
 		$csv_data .= arrayToCsv($profileData[$i]) . "\r\n";
1051 1051
 	}
1052 1052
 
1053 1053
 
1054 1054
 	header("Pragma: no-cache");
1055
-	header('Content-Disposition: attachment; filename="privacySMF'.$mode.'.csv";');
1055
+	header('Content-Disposition: attachment; filename="privacySMF' . $mode . '.csv";');
1056 1056
 	header("Content-Length: " . strlen($csv_data));
1057 1057
 	header("Content-Transfer-Encoding: binary");
1058 1058
 	header("Content-Type: application/force-download");
@@ -1071,12 +1071,12 @@  discard block
 block discarded – undo
1071 1071
  * @param boolean $encloseAll enclose all
1072 1072
  * @param boolean $nullToMysqlNull
1073 1073
   */
1074
-function arrayToCsv( array $fields, $delimiter = ';', $enclosure = '"', $encloseAll = false, $nullToMysqlNull = false ) {
1074
+function arrayToCsv(array $fields, $delimiter = ';', $enclosure = '"', $encloseAll = false, $nullToMysqlNull = false) {
1075 1075
 	$delimiter_esc = preg_quote($delimiter, '/');
1076 1076
 	$enclosure_esc = preg_quote($enclosure, '/');
1077 1077
 
1078 1078
 	$output = array();
1079
-	foreach ( $fields as $field )
1079
+	foreach ($fields as $field)
1080 1080
 	{
1081 1081
 		if ($field === null && $nullToMysqlNull)
1082 1082
 		{
@@ -1085,7 +1085,7 @@  discard block
 block discarded – undo
1085 1085
 		}
1086 1086
 
1087 1087
 		// Enclose fields containing $delimiter, $enclosure or whitespace
1088
-		if ( $encloseAll || preg_match( "/(?:${delimiter_esc}|${enclosure_esc}|\s)/", $field ) )
1088
+		if ($encloseAll || preg_match("/(?:${delimiter_esc}|${enclosure_esc}|\s)/", $field))
1089 1089
 		{
1090 1090
 			$output[] = $enclosure . str_replace($enclosure, $enclosure . $enclosure, $field) . $enclosure;
1091 1091
 		}
@@ -1095,7 +1095,7 @@  discard block
 block discarded – undo
1095 1095
 		}
1096 1096
 	}
1097 1097
 
1098
-	return implode( $delimiter, $output );
1098
+	return implode($delimiter, $output);
1099 1099
 }
1100 1100
 
1101 1101
 ?>
1102 1102
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1134,7 +1134,8 @@
 block discarded – undo
1134 1134
  * @param boolean $encloseAll enclose all
1135 1135
  * @param boolean $nullToMysqlNull
1136 1136
   */
1137
-function arrayToCsv( array $fields, $delimiter = ';', $enclosure = '"', $encloseAll = false, $nullToMysqlNull = false ) {
1137
+function arrayToCsv( array $fields, $delimiter = ';', $enclosure = '"', $encloseAll = false, $nullToMysqlNull = false )
1138
+{
1138 1139
 	$delimiter_esc = preg_quote($delimiter, '/');
1139 1140
 	$enclosure_esc = preg_quote($enclosure, '/');
1140 1141
 
Please login to merge, or discard this patch.
Themes/default/Profile.template.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
 		$fields = '';
460 460
 		foreach ($context['print_custom_fields']['below_signature'] as $field)
461 461
 			if (!empty($field['output_html']))
462
-				$fields .=  '
462
+				$fields .= '
463 463
 					<li>' . $field['output_html'] . '</li>';
464 464
 
465 465
 		if (!empty($fields))
@@ -3272,7 +3272,7 @@  discard block
 block discarded – undo
3272 3272
 				', $txt['profileDataCenter'], '
3273 3273
 			</h3>
3274 3274
 		</div>
3275
-		',( !empty($context['pdc']['nofound']) ? '<p class="information">' . $txt['profileDataNotFound'] . '</p>' : ''),'<div class="windowbg">
3275
+		',(!empty($context['pdc']['nofound']) ? '<p class="information">' . $txt['profileDataNotFound'] . '</p>' : ''), '<div class="windowbg">
3276 3276
 		<div>
3277 3277
 			<form action="', $scripturl, '?action=profile;area=getprofiledata;activity=profile" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator">
3278 3278
 				<p',  '', '>', (!empty($context['pdc']['own']) ? $txt['profileDownloadProfile_own'] : sprintf($txt['profileDownloadProfile_any'], $context['pdc']['name'])), ': </p>
@@ -3331,7 +3331,7 @@  discard block
 block discarded – undo
3331 3331
 				<div class="title_bar">
3332 3332
 					<h3 class="titlebg">', $txt['policy_approved'], '</h3>
3333 3333
 				</div>
3334
-				<p>' ,$context['poc']['approved_text'] , '</p>
3334
+				<p>' ,$context['poc']['approved_text'], '</p>
3335 3335
 			</div>';
3336 3336
 	if (!empty($context['poc']['newVersionText']))
3337 3337
 		echo '
@@ -3339,7 +3339,7 @@  discard block
 block discarded – undo
3339 3339
 				<div class="title_bar">
3340 3340
 					<h3 class="titlebg">', $txt['policy_new'], '</h3>
3341 3341
 				</div>
3342
-				<p>' ,$context['poc']['newVersionText'] , '</p>
3342
+				<p>' ,$context['poc']['newVersionText'], '</p>
3343 3343
 			</div>';
3344 3344
 	
3345 3345
 	if (!empty($context['poc']['showAccept']))
Please login to merge, or discard this patch.
Sources/ManageSettings.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1342,7 +1342,7 @@  discard block
 block discarded – undo
1342 1342
 					'class' => 'centercol',
1343 1343
 				),
1344 1344
 				'data' => array(
1345
-					'function' => function ($rowData)
1345
+					'function' => function($rowData)
1346 1346
 					{
1347 1347
 						$isChecked = $rowData['disabled'] ? '' : ' checked';
1348 1348
 						$onClickHandler = $rowData['can_show_register'] ? sprintf(' onclick="document.getElementById(\'reg_%1$s\').disabled = !this.checked;"', $rowData['id']) : '';
@@ -1358,7 +1358,7 @@  discard block
 block discarded – undo
1358 1358
 					'class' => 'centercol',
1359 1359
 				),
1360 1360
 				'data' => array(
1361
-					'function' => function ($rowData)
1361
+					'function' => function($rowData)
1362 1362
 					{
1363 1363
 						$isChecked = $rowData['on_register'] && !$rowData['disabled'] ? ' checked' : '';
1364 1364
 						$isDisabled = $rowData['can_show_register'] ? '' : ' disabled';
@@ -1405,15 +1405,15 @@  discard block
 block discarded – undo
1405 1405
 					'value' => $txt['custom_profile_fieldorder'],
1406 1406
 				),
1407 1407
 				'data' => array(
1408
-					'function' => function ($rowData) use ($context, $txt, $scripturl)
1408
+					'function' => function($rowData) use ($context, $txt, $scripturl)
1409 1409
 					{
1410
-						$return = '<p class="centertext bold_text">'. $rowData['field_order'] .'<br>';
1410
+						$return = '<p class="centertext bold_text">' . $rowData['field_order'] . '<br>';
1411 1411
 
1412 1412
 						if ($rowData['field_order'] > 1)
1413
-							$return .= '<a href="' . $scripturl . '?action=admin;area=featuresettings;sa=profileedit;fid=' . $rowData['id_field'] . ';move=up"><span class="toggle_up" title="'. $txt['custom_edit_order_move'] .' '. $txt['custom_edit_order_up'] .'"></span></a>';
1413
+							$return .= '<a href="' . $scripturl . '?action=admin;area=featuresettings;sa=profileedit;fid=' . $rowData['id_field'] . ';move=up"><span class="toggle_up" title="' . $txt['custom_edit_order_move'] . ' ' . $txt['custom_edit_order_up'] . '"></span></a>';
1414 1414
 
1415 1415
 						if ($rowData['field_order'] < $context['custFieldsMaxOrder'])
1416
-							$return .= '<a href="' . $scripturl . '?action=admin;area=featuresettings;sa=profileedit;fid=' . $rowData['id_field'] . ';move=down"><span class="toggle_down" title="'. $txt['custom_edit_order_move'] .' '. $txt['custom_edit_order_down'] .'"></span></a>';
1416
+							$return .= '<a href="' . $scripturl . '?action=admin;area=featuresettings;sa=profileedit;fid=' . $rowData['id_field'] . ';move=down"><span class="toggle_down" title="' . $txt['custom_edit_order_move'] . ' ' . $txt['custom_edit_order_down'] . '"></span></a>';
1417 1417
 
1418 1418
 						$return .= '</p>';
1419 1419
 
@@ -1431,7 +1431,7 @@  discard block
 block discarded – undo
1431 1431
 					'value' => $txt['custom_profile_fieldname'],
1432 1432
 				),
1433 1433
 				'data' => array(
1434
-					'function' => function ($rowData) use ($scripturl)
1434
+					'function' => function($rowData) use ($scripturl)
1435 1435
 					{
1436 1436
 						return sprintf('<a href="%1$s?action=admin;area=featuresettings;sa=profileedit;fid=%2$d">%3$s</a><div class="smalltext">%4$s</div>', $scripturl, $rowData['id_field'], $rowData['field_name'], $rowData['field_desc']);
1437 1437
 					},
@@ -1447,7 +1447,7 @@  discard block
 block discarded – undo
1447 1447
 					'value' => $txt['custom_profile_fieldtype'],
1448 1448
 				),
1449 1449
 				'data' => array(
1450
-					'function' => function ($rowData) use ($txt)
1450
+					'function' => function($rowData) use ($txt)
1451 1451
 					{
1452 1452
 						$textKey = sprintf('custom_profile_type_%1$s', $rowData['field_type']);
1453 1453
 						return isset($txt[$textKey]) ? $txt[$textKey] : $textKey;
@@ -1465,7 +1465,7 @@  discard block
 block discarded – undo
1465 1465
 					'value' => $txt['custom_profile_active'],
1466 1466
 				),
1467 1467
 				'data' => array(
1468
-					'function' => function ($rowData) use ($txt)
1468
+					'function' => function($rowData) use ($txt)
1469 1469
 					{
1470 1470
 						return $rowData['active'] ? $txt['yes'] : $txt['no'];
1471 1471
 					},
@@ -1482,7 +1482,7 @@  discard block
 block discarded – undo
1482 1482
 					'value' => $txt['custom_profile_placement'],
1483 1483
 				),
1484 1484
 				'data' => array(
1485
-					'function' => function ($rowData)
1485
+					'function' => function($rowData)
1486 1486
 					{
1487 1487
 						global $txt, $context;
1488 1488
 
@@ -1717,7 +1717,7 @@  discard block
 block discarded – undo
1717 1717
 			redirectexit('action=admin;area=featuresettings;sa=profile'); // @todo implement an error handler
1718 1718
 
1719 1719
 		// All good, proceed.
1720
-		$smcFunc['db_query']('','
1720
+		$smcFunc['db_query']('', '
1721 1721
 			UPDATE {db_prefix}custom_fields
1722 1722
 			SET field_order = {int:old_order}
1723 1723
 			WHERE field_order = {int:new_order}',
@@ -1726,7 +1726,7 @@  discard block
 block discarded – undo
1726 1726
 				'old_order' => $context['field']['order'],
1727 1727
 			)
1728 1728
 		);
1729
-		$smcFunc['db_query']('','
1729
+		$smcFunc['db_query']('', '
1730 1730
 			UPDATE {db_prefix}custom_fields
1731 1731
 			SET field_order = {int:new_order}
1732 1732
 			WHERE id_field = {int:id_field}',
@@ -1828,7 +1828,7 @@  discard block
 block discarded – undo
1828 1828
 			$smcFunc['db_free_result']($request);
1829 1829
 
1830 1830
 			$unique = false;
1831
-			for ($i = 0; !$unique && $i < 9; $i ++)
1831
+			for ($i = 0; !$unique && $i < 9; $i++)
1832 1832
 			{
1833 1833
 				if (!in_array($col_name, $current_fields))
1834 1834
 					$unique = true;
@@ -2001,7 +2001,7 @@  discard block
 block discarded – undo
2001 2001
 		);
2002 2002
 
2003 2003
 		// Re-arrange the order.
2004
-		$smcFunc['db_query']('','
2004
+		$smcFunc['db_query']('', '
2005 2005
 			UPDATE {db_prefix}custom_fields
2006 2006
 			SET field_order = field_order - 1
2007 2007
 			WHERE field_order > {int:current_order}',
@@ -2266,7 +2266,7 @@  discard block
 block discarded – undo
2266 2266
 	$context['token_check'] = 'noti-admin';
2267 2267
 
2268 2268
 	// Specify our action since we'll want to post back here instead of the profile
2269
-	$context['action'] = 'action=admin;area=featuresettings;sa=alerts;'. $context['session_var'] .'='. $context['session_id'];
2269
+	$context['action'] = 'action=admin;area=featuresettings;sa=alerts;' . $context['session_var'] . '=' . $context['session_id'];
2270 2270
 
2271 2271
 	loadTemplate('Profile');
2272 2272
 	loadLanguage('Profile');
@@ -2438,10 +2438,10 @@  discard block
 block discarded – undo
2438 2438
 			if (!empty($_REQUEST['save_new_policy']))
2439 2439
 				$currentVersion++;
2440 2440
 			
2441
-			$config_vars[] = array('text', 'policy_text'.$currentVersion);
2442
-			$_POST['policy_text'.$currentVersion] = $_REQUEST['policy_text'];
2441
+			$config_vars[] = array('text', 'policy_text' . $currentVersion);
2442
+			$_POST['policy_text' . $currentVersion] = $_REQUEST['policy_text'];
2443 2443
 			$config_vars[] = array('text', 'policy_version');
2444
-			$_POST['policy_version'] = 'policy_text'.$currentVersion;
2444
+			$_POST['policy_version'] = 'policy_text' . $currentVersion;
2445 2445
 			unset($config_vars[1]);
2446 2446
 			saveDBSettings($config_vars);
2447 2447
 		}
@@ -2499,7 +2499,7 @@  discard block
 block discarded – undo
2499 2499
 			)
2500 2500
 		);
2501 2501
 		
2502
-		$smcFunc['db_query']('','
2502
+		$smcFunc['db_query']('', '
2503 2503
 			DELETE FROM {db_prefix}settings
2504 2504
 			WHERE variable = {string:policy_text}',
2505 2505
 			array(
Please login to merge, or discard this patch.
Themes/default/Admin.template.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -955,7 +955,7 @@  discard block
 block discarded – undo
955 955
 				}
956 956
 
957 957
 				echo isset($config_var['postinput']) ? '
958
-											' . $config_var['postinput'] : '','
958
+											' . $config_var['postinput'] : '', '
959 959
 									</dd>';
960 960
 			}
961 961
 		}
@@ -1672,7 +1672,7 @@  discard block
 block discarded – undo
1672 1672
 								</dl>
1673 1673
 								<input type="submit" name="save_setting" value="', $txt['save'], '" class="button">
1674 1674
 								<div class="block">
1675
-									',template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message') ,'
1675
+									',template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'), '
1676 1676
 								</div>
1677 1677
 								<input type="submit" name="save_new_policy" value="', $txt['policy_save'], '" class="button">
1678 1678
 								<input type="submit" name="update_policy" value="', $txt['policy_update'], '" class="button">								
@@ -1717,11 +1717,11 @@  discard block
 block discarded – undo
1717 1717
 							</div>
1718 1718
 							<div class="windowbg">
1719 1719
 								<dl class="settings">';
1720
-	$count = ( is_array($context['poc']['policy_management']) ? count($context['poc']['policy_management']) : 0);
1720
+	$count = (is_array($context['poc']['policy_management']) ? count($context['poc']['policy_management']) : 0);
1721 1721
 	foreach ($context['poc']['policy_management'] as $row)
1722 1722
 	{
1723 1723
 		echo '
1724
-									<dt>', ($row['new'] ? $txt['policy_current'] : '<input type="submit" name="delete_policy" value="' . $row['name'] . '" class="button">') , '</dt><dd>', $row['amount'], '</dd>';
1724
+									<dt>', ($row['new'] ? $txt['policy_current'] : '<input type="submit" name="delete_policy" value="' . $row['name'] . '" class="button">'), '</dt><dd>', $row['amount'], '</dd>';
1725 1725
 	}
1726 1726
 	echo '
1727 1727
 								</dl>
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
  *
103 103
  * @param string $class The fully-qualified class name.
104 104
  */
105
-spl_autoload_register(function ($class) use ($sourcedir)
105
+spl_autoload_register(function($class) use ($sourcedir)
106 106
 {
107 107
 	$classMap = array(
108 108
 		'ReCaptcha\\' => 'ReCaptcha/',
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 	{
218 218
 		global $options;
219 219
 		if (empty($options['policy_isvalid']) && 
220
-				(empty($_REQUEST['area']) || (!empty($_REQUEST['area']) && $_REQUEST['area'] != 'getpolicydata')) )
220
+				(empty($_REQUEST['area']) || (!empty($_REQUEST['area']) && $_REQUEST['area'] != 'getpolicydata')))
221 221
 			$show_privacy = true;
222 222
 	}
223 223
 
Please login to merge, or discard this patch.