Completed
Push — release-2.1 ( 286127...e6c696 )
by Mathias
11s
created
Sources/Class-Package.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 			if ((!isset($match[3]) || trim($match[3]) != '/') && (!isset($match[2]) || trim($match[2]) != '/'))
425 425
 			{
426 426
 				// Because PHP 5.2.0+ seems to croak using regex, we'll have to do this the less fun way.
427
-				$last_tag_end = strpos($data, '</' . $match[1]. '>');
427
+				$last_tag_end = strpos($data, '</' . $match[1] . '>');
428 428
 				if ($last_tag_end === false)
429 429
 					continue;
430 430
 
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 						break;
439 439
 
440 440
 					// If not then find the next ending tag.
441
-					$next_tag_end = strpos($data, '</' . $match[1]. '>', $offset);
441
+					$next_tag_end = strpos($data, '</' . $match[1] . '>', $offset);
442 442
 
443 443
 					// Didn't find one? Then just use the last and sod it.
444 444
 					if ($next_tag_end === false)
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 				// Parse the insides.
453 453
 				$inner_match = substr($data, 0, $last_tag_end);
454 454
 				// Data now starts from where this section ends.
455
-				$data = substr($data, $last_tag_end + strlen('</' . $match[1]. '>'));
455
+				$data = substr($data, $last_tag_end + strlen('</' . $match[1] . '>'));
456 456
 
457 457
 				if (!empty($inner_match))
458 458
 				{
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
 		$trans_tbl = array_flip(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES));
619 619
 
620 620
 		// Translate all the entities out.
621
-		$data = strtr(preg_replace_callback('~&#(\d{1,4});~', function ($m)
621
+		$data = strtr(preg_replace_callback('~&#(\d{1,4});~', function($m)
622 622
 		{
623 623
 			return chr("$m[1]");
624 624
 		}, $data), $trans_tbl);
@@ -873,7 +873,7 @@  discard block
 block discarded – undo
873 873
 		// Set different modes.
874 874
 		$chmod_values = $is_dir ? array(0750, 0755, 0775, 0777) : array(0644, 0664, 0666);
875 875
 
876
-		foreach($chmod_values as $val)
876
+		foreach ($chmod_values as $val)
877 877
 		{
878 878
 			// If it's writable, break out of the loop.
879 879
 			if (is_writable($ftp_file))
Please login to merge, or discard this patch.
Sources/ReportedContent.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 	// Get the report details.
188 188
 	$report = getReportDetails($report_id);
189 189
 
190
-	if(!$report)
190
+	if (!$report)
191 191
 		fatal_lang_error('mc_no_modreport_found');
192 192
 
193 193
 	// Build the report data - basic details first, then extra stuff based on the type
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 	if ($context['report_type'] == 'members')
251 251
 	{
252 252
 		// Find their ID in the serialized action string...
253
-		$user_id_length = strlen((string)$context['report']['user']['id']);
253
+		$user_id_length = strlen((string) $context['report']['user']['id']);
254 254
 		$member = 's:6:"member";s:' . $user_id_length . ':"' . $context['report']['user']['id'] . '";}';
255 255
 
256 256
 		$params = array(
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
 	// What are we gonna do?
530 530
 	$action = isset($_GET['ignore']) ? 'ignore' : 'closed';
531 531
 
532
-	validateToken('mod-report-'. $action, 'get');
532
+	validateToken('mod-report-' . $action, 'get');
533 533
 
534 534
 	// Are we ignore or "un-ignore"? "un-ignore" that's a funny word!
535 535
 	$value = (int) $_GET[$action];
Please login to merge, or discard this patch.
Sources/ManageSettings.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1326,7 +1326,7 @@  discard block
 block discarded – undo
1326 1326
 					'class' => 'centercol',
1327 1327
 				),
1328 1328
 				'data' => array(
1329
-					'function' => function ($rowData)
1329
+					'function' => function($rowData)
1330 1330
 					{
1331 1331
 						$isChecked = $rowData['disabled'] ? '' : ' checked';
1332 1332
 						$onClickHandler = $rowData['can_show_register'] ? sprintf(' onclick="document.getElementById(\'reg_%1$s\').disabled = !this.checked;"', $rowData['id']) : '';
@@ -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['on_register'] && !$rowData['disabled'] ? ' checked' : '';
1348 1348
 						$isDisabled = $rowData['can_show_register'] ? '' : ' disabled';
@@ -1389,15 +1389,15 @@  discard block
 block discarded – undo
1389 1389
 					'value' => $txt['custom_profile_fieldorder'],
1390 1390
 				),
1391 1391
 				'data' => array(
1392
-					'function' => function ($rowData) use ($context, $txt, $scripturl)
1392
+					'function' => function($rowData) use ($context, $txt, $scripturl)
1393 1393
 					{
1394
-						$return = '<p class="centertext bold_text">'. $rowData['field_order'] .'<br />';
1394
+						$return = '<p class="centertext bold_text">' . $rowData['field_order'] . '<br />';
1395 1395
 
1396 1396
 						if ($rowData['field_order'] > 1)
1397
-							$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>';
1397
+							$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>';
1398 1398
 
1399 1399
 						if ($rowData['field_order'] < $context['custFieldsMaxOrder'])
1400
-							$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>';
1400
+							$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>';
1401 1401
 
1402 1402
 						$return .= '</p>';
1403 1403
 
@@ -1415,7 +1415,7 @@  discard block
 block discarded – undo
1415 1415
 					'value' => $txt['custom_profile_fieldname'],
1416 1416
 				),
1417 1417
 				'data' => array(
1418
-					'function' => function ($rowData) use ($scripturl)
1418
+					'function' => function($rowData) use ($scripturl)
1419 1419
 					{
1420 1420
 						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']);
1421 1421
 					},
@@ -1431,7 +1431,7 @@  discard block
 block discarded – undo
1431 1431
 					'value' => $txt['custom_profile_fieldtype'],
1432 1432
 				),
1433 1433
 				'data' => array(
1434
-					'function' => function ($rowData) use ($txt)
1434
+					'function' => function($rowData) use ($txt)
1435 1435
 					{
1436 1436
 						$textKey = sprintf('custom_profile_type_%1$s', $rowData['field_type']);
1437 1437
 						return isset($txt[$textKey]) ? $txt[$textKey] : $textKey;
@@ -1449,7 +1449,7 @@  discard block
 block discarded – undo
1449 1449
 					'value' => $txt['custom_profile_active'],
1450 1450
 				),
1451 1451
 				'data' => array(
1452
-					'function' => function ($rowData) use ($txt)
1452
+					'function' => function($rowData) use ($txt)
1453 1453
 					{
1454 1454
 						return $rowData['active'] ? $txt['yes'] : $txt['no'];
1455 1455
 					},
@@ -1466,7 +1466,7 @@  discard block
 block discarded – undo
1466 1466
 					'value' => $txt['custom_profile_placement'],
1467 1467
 				),
1468 1468
 				'data' => array(
1469
-					'function' => function ($rowData)
1469
+					'function' => function($rowData)
1470 1470
 					{
1471 1471
 						global $txt, $context;
1472 1472
 
@@ -1701,7 +1701,7 @@  discard block
 block discarded – undo
1701 1701
 			redirectexit('action=admin;area=featuresettings;sa=profile'); // @todo implement an error handler
1702 1702
 
1703 1703
 		// All good, proceed.
1704
-		$smcFunc['db_query']('','
1704
+		$smcFunc['db_query']('', '
1705 1705
 			UPDATE {db_prefix}custom_fields
1706 1706
 			SET field_order = {int:old_order}
1707 1707
 			WHERE field_order = {int:new_order}',
@@ -1710,7 +1710,7 @@  discard block
 block discarded – undo
1710 1710
 				'old_order' => $context['field']['order'],
1711 1711
 			)
1712 1712
 		);
1713
-		$smcFunc['db_query']('','
1713
+		$smcFunc['db_query']('', '
1714 1714
 			UPDATE {db_prefix}custom_fields
1715 1715
 			SET field_order = {int:new_order}
1716 1716
 			WHERE id_field = {int:id_field}',
@@ -1812,7 +1812,7 @@  discard block
 block discarded – undo
1812 1812
 			$smcFunc['db_free_result']($request);
1813 1813
 
1814 1814
 			$unique = false;
1815
-			for ($i = 0; !$unique && $i < 9; $i ++)
1815
+			for ($i = 0; !$unique && $i < 9; $i++)
1816 1816
 			{
1817 1817
 				if (!in_array($col_name, $current_fields))
1818 1818
 					$unique = true;
@@ -1985,7 +1985,7 @@  discard block
 block discarded – undo
1985 1985
 		);
1986 1986
 
1987 1987
 		// Re-arrange the order.
1988
-		$smcFunc['db_query']('','
1988
+		$smcFunc['db_query']('', '
1989 1989
 			UPDATE {db_prefix}custom_fields
1990 1990
 			SET field_order = field_order - 1
1991 1991
 			WHERE field_order > {int:current_order}',
@@ -2249,7 +2249,7 @@  discard block
 block discarded – undo
2249 2249
 	$context['token_check'] = 'noti-admin';
2250 2250
 
2251 2251
 	// Specify our action since we'll want to post back here instead of the profile
2252
-	$context['action'] = 'action=admin;area=featuresettings;sa=alerts;'. $context['session_var'] .'='. $context['session_id'];
2252
+	$context['action'] = 'action=admin;area=featuresettings;sa=alerts;' . $context['session_var'] . '=' . $context['session_id'];
2253 2253
 
2254 2254
 	loadTemplate('Profile');
2255 2255
 	loadLanguage('Profile');
Please login to merge, or discard this patch.
Sources/Security.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	require_once($sourcedir . '/Subs-Auth.php');
53 53
 
54 54
 	// Posting the password... check it.
55
-	if (isset($_POST[$type. '_pass']))
55
+	if (isset($_POST[$type . '_pass']))
56 56
 	{
57 57
 		// Check to ensure we're forcing SSL for authentication
58 58
 		if (!empty($modSettings['force_ssl']) && empty($maintenance) && (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on'))
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 		{
180 180
 			if ($ip_number == 'ip2' && $user_info['ip2'] == $user_info['ip'])
181 181
 				continue;
182
-			$ban_query[] = ' {inet:'.$ip_number.'} BETWEEN bi.ip_low and bi.ip_high';
182
+			$ban_query[] = ' {inet:' . $ip_number . '} BETWEEN bi.ip_low and bi.ip_high';
183 183
 			$ban_query_vars[$ip_number] = $user_info[$ip_number];
184 184
 			// IP was valid, maybe there's also a hostname...
185 185
 			if (empty($modSettings['disableHostnameLookup']) && $user_info[$ip_number] != 'unknown')
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
 				$hostname = host_from_ip($user_info[$ip_number]);
188 188
 				if (strlen($hostname) > 0)
189 189
 				{
190
-					$ban_query[] = '({string:hostname'.$ip_number.'} LIKE bi.hostname)';
191
-					$ban_query_vars['hostname'.$ip_number] = $hostname;
190
+					$ban_query[] = '({string:hostname' . $ip_number . '} LIKE bi.hostname)';
191
+					$ban_query_vars['hostname' . $ip_number] = $hostname;
192 192
 				}
193 193
 			}
194 194
 		}
@@ -912,7 +912,7 @@  discard block
 block discarded – undo
912 912
 		return true;
913 913
 
914 914
 	// Let's ensure this is an array.
915
-	$permission = (array)$permission;
915
+	$permission = (array) $permission;
916 916
 
917 917
 	// Are we checking the _current_ board, or some other boards?
918 918
 	if ($boards === null)
Please login to merge, or discard this patch.
Sources/Subs-Db-mysql.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 						$replacement[$key] = 'null';
252 252
 					if (!isValidIP($value))
253 253
 						smf_db_error_backtrace('Wrong value type sent to the database. IPv4 or IPv6 expected.(' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
254
-					$replacement[$key] =  sprintf('unhex(\'%1$s\')', bin2hex(inet_pton($value)));
254
+					$replacement[$key] = sprintf('unhex(\'%1$s\')', bin2hex(inet_pton($value)));
255 255
 				}
256 256
 
257 257
 				return implode(', ', $replacement);
@@ -810,7 +810,7 @@  discard block
 block discarded – undo
810 810
  * @param bool $translate_human_wildcards If true, turns human readable wildcards into SQL wildcards.
811 811
  * @return string The escaped string
812 812
  */
813
-function smf_db_escape_wildcard_string($string, $translate_human_wildcards=false)
813
+function smf_db_escape_wildcard_string($string, $translate_human_wildcards = false)
814 814
 {
815 815
 	$replacements = array(
816 816
 		'%' => '\%',
Please login to merge, or discard this patch.
Sources/Register.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -501,7 +501,7 @@
 block discarded – undo
501 501
 	{
502 502
 		call_integration_hook('integrate_activate', array($regOptions['username']));
503 503
 
504
-		setLoginCookie(60 * $modSettings['cookieTime'], $memberID, hash_salt($regOptions['register_vars']['passwd'],  $regOptions['register_vars']['password_salt']));
504
+		setLoginCookie(60 * $modSettings['cookieTime'], $memberID, hash_salt($regOptions['register_vars']['passwd'], $regOptions['register_vars']['password_salt']));
505 505
 
506 506
 		redirectexit('action=login2;sa=check;member=' . $memberID, $context['server']['needs_login_fix']);
507 507
 	}
Please login to merge, or discard this patch.
Sources/Load.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -76,15 +76,15 @@  discard block
 block discarded – undo
76 76
 
77 77
 	// Set a list of common functions.
78 78
 	$ent_list = empty($modSettings['disableEntityCheck']) ? '&(#\d{1,7}|quot|amp|lt|gt|nbsp);' : '&(#021|quot|amp|lt|gt|nbsp);';
79
-	$ent_check = empty($modSettings['disableEntityCheck']) ? function ($string)
79
+	$ent_check = empty($modSettings['disableEntityCheck']) ? function($string)
80 80
 		{
81 81
 			$string = preg_replace_callback('~(&#(\d{1,7}|x[0-9a-fA-F]{1,6});)~', 'entity_fix__callback', $string);
82 82
 			return $string;
83
-		} : function ($string)
83
+		} : function($string)
84 84
 		{
85 85
 			return $string;
86 86
 		};
87
-	$fix_utf8mb4 = function ($string) use ($utf8)
87
+	$fix_utf8mb4 = function($string) use ($utf8)
88 88
 	{
89 89
 		if (!$utf8)
90 90
 			return $string;
@@ -102,21 +102,21 @@  discard block
 block discarded – undo
102 102
 			}
103 103
 			elseif ($ord < 224)
104 104
 			{
105
-				$new_string .= $string[$i] . $string[$i+1];
105
+				$new_string .= $string[$i] . $string[$i + 1];
106 106
 				$i += 2;
107 107
 			}
108 108
 			elseif ($ord < 240)
109 109
 			{
110
-				$new_string .= $string[$i] . $string[$i+1] . $string[$i+2];
110
+				$new_string .= $string[$i] . $string[$i + 1] . $string[$i + 2];
111 111
 				$i += 3;
112 112
 			}
113 113
 			elseif ($ord < 248)
114 114
 			{
115 115
 				// Magic happens.
116 116
 				$val = (ord($string[$i]) & 0x07) << 18;
117
-				$val += (ord($string[$i+1]) & 0x3F) << 12;
118
-				$val += (ord($string[$i+2]) & 0x3F) << 6;
119
-				$val += (ord($string[$i+3]) & 0x3F);
117
+				$val += (ord($string[$i + 1]) & 0x3F) << 12;
118
+				$val += (ord($string[$i + 2]) & 0x3F) << 6;
119
+				$val += (ord($string[$i + 3]) & 0x3F);
120 120
 				$new_string .= '&#' . $val . ';';
121 121
 				$i += 4;
122 122
 			}
@@ -129,24 +129,24 @@  discard block
 block discarded – undo
129 129
 
130 130
 	// global array of anonymous helper functions, used mostly to properly handle multi byte strings
131 131
 	$smcFunc += array(
132
-		'entity_fix' => function ($string)
132
+		'entity_fix' => function($string)
133 133
 		{
134 134
 			$num = $string[0] === 'x' ? hexdec(substr($string, 1)) : (int) $string;
135 135
 			return $num < 0x20 || $num > 0x10FFFF || ($num >= 0xD800 && $num <= 0xDFFF) || $num === 0x202E || $num === 0x202D ? '' : '&#' . $num . ';';
136 136
 		},
137
-		'htmlspecialchars' => function ($string, $quote_style = ENT_COMPAT, $charset = 'ISO-8859-1') use ($ent_check, $utf8, $fix_utf8mb4)
137
+		'htmlspecialchars' => function($string, $quote_style = ENT_COMPAT, $charset = 'ISO-8859-1') use ($ent_check, $utf8, $fix_utf8mb4)
138 138
 		{
139 139
 			return $fix_utf8mb4($ent_check(htmlspecialchars($string, $quote_style, $utf8 ? 'UTF-8' : $charset)));
140 140
 		},
141
-		'htmltrim' => function ($string) use ($utf8, $space_chars, $ent_check)
141
+		'htmltrim' => function($string) use ($utf8, $space_chars, $ent_check)
142 142
 		{
143 143
 			return preg_replace('~^(?:[ \t\n\r\x0B\x00' . $space_chars . ']|&nbsp;)+|(?:[ \t\n\r\x0B\x00' . $space_chars . ']|&nbsp;)+$~' . ($utf8 ? 'u' : ''), '', $ent_check($string));
144 144
 		},
145
-		'strlen' => function ($string) use ($ent_list, $utf8, $ent_check)
145
+		'strlen' => function($string) use ($ent_list, $utf8, $ent_check)
146 146
 		{
147 147
 			return strlen(preg_replace('~' . $ent_list . ($utf8 ? '|.~u' : '~'), '_', $ent_check($string)));
148 148
 		},
149
-		'strpos' => function ($haystack, $needle, $offset = 0) use ($utf8, $ent_check, $modSettings)
149
+		'strpos' => function($haystack, $needle, $offset = 0) use ($utf8, $ent_check, $modSettings)
150 150
 		{
151 151
 			$haystack_arr = preg_split('~(&#' . (empty($modSettings['disableEntityCheck']) ? '\d{1,7}' : '021') . ';|&quot;|&amp;|&lt;|&gt;|&nbsp;|.)~' . ($utf8 ? 'u' : ''), $ent_check($haystack), -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
152 152
 
@@ -171,12 +171,12 @@  discard block
 block discarded – undo
171 171
 				return false;
172 172
 			}
173 173
 		},
174
-		'substr' => function ($string, $start, $length = null) use ($utf8, $ent_check, $modSettings)
174
+		'substr' => function($string, $start, $length = null) use ($utf8, $ent_check, $modSettings)
175 175
 		{
176 176
 			$ent_arr = preg_split('~(&#' . (empty($modSettings['disableEntityCheck']) ? '\d{1,7}' : '021') . ';|&quot;|&amp;|&lt;|&gt;|&nbsp;|.)~' . ($utf8 ? 'u' : '') . '', $ent_check($string), -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
177 177
 			return $length === null ? implode('', array_slice($ent_arr, $start)) : implode('', array_slice($ent_arr, $start, $length));
178 178
 		},
179
-		'strtolower' => $utf8 ? function ($string) use ($sourcedir)
179
+		'strtolower' => $utf8 ? function($string) use ($sourcedir)
180 180
 		{
181 181
 			if (!function_exists('mb_strtolower'))
182 182
 			{
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 
187 187
 			return mb_strtolower($string, 'UTF-8');
188 188
 		} : 'strtolower',
189
-		'strtoupper' => $utf8 ? function ($string)
189
+		'strtoupper' => $utf8 ? function($string)
190 190
 		{
191 191
 			global $sourcedir;
192 192
 
@@ -201,17 +201,17 @@  discard block
 block discarded – undo
201 201
 		'truncate' => function($string, $length) use ($utf8, $ent_check, $ent_list, &$smcFunc)
202 202
 		{
203 203
 			$string = $ent_check($string);
204
-			preg_match('~^(' . $ent_list . '|.){' . $smcFunc['strlen'](substr($string, 0, $length)) . '}~'.  ($utf8 ? 'u' : ''), $string, $matches);
204
+			preg_match('~^(' . $ent_list . '|.){' . $smcFunc['strlen'](substr($string, 0, $length)) . '}~' . ($utf8 ? 'u' : ''), $string, $matches);
205 205
 			$string = $matches[0];
206 206
 			while (strlen($string) > $length)
207
-				$string = preg_replace('~(?:' . $ent_list . '|.)$~'.  ($utf8 ? 'u' : ''), '', $string);
207
+				$string = preg_replace('~(?:' . $ent_list . '|.)$~' . ($utf8 ? 'u' : ''), '', $string);
208 208
 			return $string;
209 209
 		},
210
-		'ucfirst' => $utf8 ? function ($string) use (&$smcFunc)
210
+		'ucfirst' => $utf8 ? function($string) use (&$smcFunc)
211 211
 		{
212 212
 			return $smcFunc['strtoupper']($smcFunc['substr']($string, 0, 1)) . $smcFunc['substr']($string, 1);
213 213
 		} : 'ucfirst',
214
-		'ucwords' => $utf8 ? function ($string) use (&$smcFunc)
214
+		'ucwords' => $utf8 ? function($string) use (&$smcFunc)
215 215
 		{
216 216
 			$words = preg_split('~([\s\r\n\t]+)~', $string, -1, PREG_SPLIT_DELIM_CAPTURE);
217 217
 			for ($i = 0, $n = count($words); $i < $n; $i += 2)
@@ -610,7 +610,7 @@  discard block
 block discarded – undo
610 610
 		else
611 611
 		{
612 612
 			// !!! Compatibility.
613
-			$user_info['time_offset'] = empty($user_settings['time_offset']) ? 0 :$user_settings['time_offset'];
613
+			$user_info['time_offset'] = empty($user_settings['time_offset']) ? 0 : $user_settings['time_offset'];
614 614
 		}
615 615
 	}
616 616
 	// If the user is a guest, initialize all the critical user settings.
@@ -1265,9 +1265,9 @@  discard block
 block discarded – undo
1265 1265
 			if ($image_proxy_enabled && !empty($row['avatar']) && stripos($row['avatar'], 'http://') !== false)
1266 1266
 				$row['avatar'] = $boardurl . '/proxy.php?request=' . urlencode($row['avatar']) . '&hash=' . md5($row['avatar'] . $image_proxy_secret);
1267 1267
 
1268
-			if ( isset($row['member_ip']) )
1268
+			if (isset($row['member_ip']))
1269 1269
 				$row['member_ip'] = inet_dtop($row['member_ip']);
1270
-			if ( isset($row['member_ip2']) )
1270
+			if (isset($row['member_ip2']))
1271 1271
 				$row['member_ip2'] = inet_dtop($row['member_ip2']);
1272 1272
 			$new_loaded_ids[] = $row['id_member'];
1273 1273
 			$loaded_ids[] = $row['id_member'];
@@ -1415,7 +1415,7 @@  discard block
 block discarded – undo
1415 1415
 		'name' => $profile['real_name'],
1416 1416
 		'id' => $profile['id_member'],
1417 1417
 		'href' => $scripturl . '?action=profile;u=' . $profile['id_member'],
1418
-		'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['id_member'] . '" title="' . $txt['profile_of'] . ' ' . $profile['real_name'] . '" '. (!empty($modSettings['onlineEnable']) ? 'class="pm_icon"' : '').'>' . $profile['real_name'] . '</a>',
1418
+		'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['id_member'] . '" title="' . $txt['profile_of'] . ' ' . $profile['real_name'] . '" ' . (!empty($modSettings['onlineEnable']) ? 'class="pm_icon"' : '') . '>' . $profile['real_name'] . '</a>',
1419 1419
 		'email' => $profile['email_address'],
1420 1420
 		'show_email' => !$user_info['is_guest'] && ($user_info['id'] == $profile['id_member'] || allowedTo('moderate_forum')),
1421 1421
 		'registered' => empty($profile['date_registered']) ? $txt['not_applicable'] : timeformat($profile['date_registered']),
@@ -1430,9 +1430,9 @@  discard block
 block discarded – undo
1430 1430
 			$loadedLanguages = getLanguages();
1431 1431
 
1432 1432
 		$memberContext[$user] += array(
1433
-			'username_color' => '<span '. (!empty($profile['member_group_color']) ? 'style="color:'. $profile['member_group_color'] .';"' : '') .'>'. $profile['member_name'] .'</span>',
1434
-			'name_color' => '<span '. (!empty($profile['member_group_color']) ? 'style="color:'. $profile['member_group_color'] .';"' : '') .'>'. $profile['real_name'] .'</span>',
1435
-			'link_color' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['id_member'] . '" title="' . $txt['profile_of'] . ' ' . $profile['real_name'] . '" '. (!empty($profile['member_group_color']) ? 'style="color:'. $profile['member_group_color'] .';"' : '') .'>' . $profile['real_name'] . '</a>',
1433
+			'username_color' => '<span ' . (!empty($profile['member_group_color']) ? 'style="color:' . $profile['member_group_color'] . ';"' : '') . '>' . $profile['member_name'] . '</span>',
1434
+			'name_color' => '<span ' . (!empty($profile['member_group_color']) ? 'style="color:' . $profile['member_group_color'] . ';"' : '') . '>' . $profile['real_name'] . '</span>',
1435
+			'link_color' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['id_member'] . '" title="' . $txt['profile_of'] . ' ' . $profile['real_name'] . '" ' . (!empty($profile['member_group_color']) ? 'style="color:' . $profile['member_group_color'] . ';"' : '') . '>' . $profile['real_name'] . '</a>',
1436 1436
 			'is_buddy' => $profile['buddy'],
1437 1437
 			'is_reverse_buddy' => in_array($user_info['id'], $buddy_list),
1438 1438
 			'buddies' => $buddy_list,
@@ -1502,7 +1502,7 @@  discard block
 block discarded – undo
1502 1502
 		if (!empty($image))
1503 1503
 			$memberContext[$user]['avatar'] = array(
1504 1504
 				'name' => $profile['avatar'],
1505
-				'image' => '<img class="avatar" src="' . $image . '" alt="avatar_'. $profile['member_name'].'">',
1505
+				'image' => '<img class="avatar" src="' . $image . '" alt="avatar_' . $profile['member_name'] . '">',
1506 1506
 				'href' => $image,
1507 1507
 				'url' => $image,
1508 1508
 			);
@@ -2828,7 +2828,7 @@  discard block
 block discarded – undo
2828 2828
 					$langName = $smcFunc['ucwords'](strtr($matches[1], array('_' => ' ')));
2829 2829
 
2830 2830
 					// Get the line we need.
2831
-					$fp = @fopen($language_dir .'/'. $entry);
2831
+					$fp = @fopen($language_dir . '/' . $entry);
2832 2832
 
2833 2833
 					// Yay!
2834 2834
 					if ($fp)
Please login to merge, or discard this patch.
Sources/Subs-Attachments.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 	{
151 151
 		if (!@is_dir($directory))
152 152
 		{
153
-			if (!@mkdir($directory,0755))
153
+			if (!@mkdir($directory, 0755))
154 154
 			{
155 155
 				$context['dir_creation_error'] = 'attachments_no_create';
156 156
 				return false;
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
  *
249 249
  * @return array|bool An array of all the directories and subdirectories or false on failure
250 250
  */
251
-function get_directory_tree_elements ($directory)
251
+function get_directory_tree_elements($directory)
252 252
 {
253 253
 	/*
254 254
 		In Windows server both \ and / can be used as directory separators in paths
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 		if (substr($directory, 0, 1) != DIRECTORY_SEPARATOR)
265 265
 			return false;
266 266
 
267
-		$tree = explode(DIRECTORY_SEPARATOR, trim($directory,DIRECTORY_SEPARATOR));
267
+		$tree = explode(DIRECTORY_SEPARATOR, trim($directory, DIRECTORY_SEPARATOR));
268 268
 	}
269 269
 	return $tree;
270 270
 }
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
  *
278 278
  * @return string|bool The first part of the path or false on error
279 279
  */
280
-function attachments_init_dir (&$tree, &$count)
280
+function attachments_init_dir(&$tree, &$count)
281 281
 {
282 282
 	$directory = '';
283 283
 	// If on Windows servers the first part of the path is the drive (e.g. "C:")
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 		 //Better be sure that the first part of the path is actually a drive letter...
287 287
 		 //...even if, I should check this in the admin page...isn't it?
288 288
 		 //...NHAAA Let's leave space for users' complains! :P
289
-		if (preg_match('/^[a-z]:$/i',$tree[0]))
289
+		if (preg_match('/^[a-z]:$/i', $tree[0]))
290 290
 			$directory = array_shift($tree);
291 291
 		else
292 292
 			return false;
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
 	global $modSettings, $context, $sourcedir, $smcFunc;
485 485
 
486 486
 	// No data or missing data .... Not necessarily needed, but in case a mod author missed something.
487
-	if ( empty($_SESSION['temp_attachments'][$attachID]))
487
+	if (empty($_SESSION['temp_attachments'][$attachID]))
488 488
 		$error = '$_SESSION[\'temp_attachments\'][$attachID]';
489 489
 
490 490
 	elseif (empty($attachID))
@@ -911,9 +911,9 @@  discard block
 block discarded – undo
911 911
 		$attachContext = $attachLoaded[$attachID];
912 912
 
913 913
 		// Fix the url to point out to showAvatar().
914
-		$attachContext['href'] = $scripturl . '?action=dlattach;attach=' . $attachID .';type=preview';
914
+		$attachContext['href'] = $scripturl . '?action=dlattach;attach=' . $attachID . ';type=preview';
915 915
 
916
-		$attachContext['link'] = '<a href="' . $scripturl . '?action=dlattach;attach=' . $attachID .';type=preview'. (empty($attachContext['is_image']) ? ';file' : '') .'">' . $smcFunc['htmlspecialchars']($attachContext['name']) . '</a>';
916
+		$attachContext['link'] = '<a href="' . $scripturl . '?action=dlattach;attach=' . $attachID . ';type=preview' . (empty($attachContext['is_image']) ? ';file' : '') . '">' . $smcFunc['htmlspecialchars']($attachContext['name']) . '</a>';
917 917
 
918 918
 		// Fix the thumbnail too, if the image has one.
919 919
 		if (!empty($attachContext['thumbnail']) && !empty($attachContext['thumbnail']['has_thumb']))
@@ -1078,7 +1078,7 @@  discard block
 block discarded – undo
1078 1078
 				LEFT JOIN {db_prefix}attachments AS thumb ON (thumb.id_attach = a.id_thumb)') . '
1079 1079
 				LEFT JOIN {db_prefix}messages AS m ON (m.id_msg = a.id_msg)
1080 1080
 			WHERE a.attachment_type = {int:attachment_type}
1081
-				'. (!empty($msgID) ? 'AND a.id_msg = {int:message_id}' : '') .'',
1081
+				'. (!empty($msgID) ? 'AND a.id_msg = {int:message_id}' : '') . '',
1082 1082
 			array(
1083 1083
 				'message_id' => $msgID,
1084 1084
 				'attachment_type' => 0,
Please login to merge, or discard this patch.
Sources/SearchAPI-Fulltext.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -206,12 +206,12 @@  discard block
 block discarded – undo
206 206
 
207 207
 		if (!empty($modSettings['search_simple_fulltext']))
208 208
 		{
209
-			if($smcFunc['db_title'] == "PostgreSQL")
209
+			if ($smcFunc['db_title'] == "PostgreSQL")
210 210
 			{
211 211
 				//we use the default language "default_text_search_config", otherwise we had to assgine the language here
212 212
 				//to_tsvector(body) -> to_tsvector($language,body) to_tsquery(...) -> to_tsquery($language,...)
213 213
 				$language_ftx = 'english';
214
-				$request = $smcFunc['db_query']('','
214
+				$request = $smcFunc['db_query']('', '
215 215
 					SHOW default_text_search_config',
216 216
 					array()
217 217
 				);
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 			// remove any indexed words that are used in the complex body search terms
236 236
 			$words['indexed_words'] = array_diff($words['indexed_words'], $words['complex_words']);
237 237
 
238
-			if($smcFunc['db_title'] == "PostgreSQL"){
238
+			if ($smcFunc['db_title'] == "PostgreSQL") {
239 239
 				$row = 0;
240 240
 				foreach ($words['indexed_words'] as $fulltextWord) {
241 241
 					$query_params['boolean_match'] .= ($row <> 0 ? '&' : '');
@@ -251,12 +251,12 @@  discard block
 block discarded – undo
251 251
 
252 252
 			// if we have bool terms to search, add them in
253 253
 			if ($query_params['boolean_match']) {
254
-				if($smcFunc['db_title'] == "PostgreSQL")
254
+				if ($smcFunc['db_title'] == "PostgreSQL")
255 255
 				{
256 256
 					//we use the default language "default_text_search_config", otherwise we had to assgine the language here
257 257
 					//to_tsvector(body) -> to_tsvector($language,body) to_tsquery(...) -> to_tsquery($language,...)
258 258
 					$language_ftx = 'english';
259
-					$request = $smcFunc['db_query']('','
259
+					$request = $smcFunc['db_query']('', '
260 260
 						SHOW default_text_search_config',
261 261
 						array()
262 262
 					);
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 
276 276
 		}
277 277
 
278
-		$ignoreRequest = $smcFunc['db_search_query']('insert_into_log_messages_fulltext', ($smcFunc['db_support_ignore'] ? ( '
278
+		$ignoreRequest = $smcFunc['db_search_query']('insert_into_log_messages_fulltext', ($smcFunc['db_support_ignore'] ? ('
279 279
 			INSERT IGNORE INTO {db_prefix}' . $search_data['insert_into'] . '
280 280
 				(' . implode(', ', array_keys($query_select)) . ')') : '') . '
281 281
 			SELECT ' . implode(', ', $query_select) . '
Please login to merge, or discard this patch.