Passed
Pull Request — release-2.1 (#5093)
by 01
05:06
created
Sources/Subs-Members.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
 	$regOptions['username'] = trim(preg_replace('~[\t\n\r \x0B\0' . ($context['utf8'] ? '\x{A0}\x{AD}\x{2000}-\x{200F}\x{201F}\x{202F}\x{3000}\x{FEFF}' : '\x00-\x08\x0B\x0C\x0E-\x19\xA0') . ']+~' . ($context['utf8'] ? 'u' : ''), ' ', $regOptions['username']));
468 468
 
469 469
 	// 4-byte Unicode characters are not permitted within user names where db_mb4 is false
470
-	$regOptions['username'] = !$smcFunc['db_mb4'] && max(array_map('ord', str_split($regOptions['username']))) >= 240 ? preg_replace_callback('/[\x{10000}-\x{10FFFF}]/u', function($name) use($smcFunc){return $smcFunc['htmlspecialchars']($name[0]);}, $regOptions['username']) : $regOptions['username'];
470
+	$regOptions['username'] = !$smcFunc['db_mb4'] && max(array_map('ord', str_split($regOptions['username']))) >= 240 ? preg_replace_callback('/[\x{10000}-\x{10FFFF}]/u', function($name) use($smcFunc){return $smcFunc['htmlspecialchars']($name[0]); }, $regOptions['username']) : $regOptions['username'];
471 471
 
472 472
 	// @todo Separate the sprintf?
473 473
 	if (empty($regOptions['email']) || !filter_var($regOptions['email'], FILTER_VALIDATE_EMAIL) || strlen($regOptions['email']) > 255)
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
 		'member_name' => $regOptions['username'],
590 590
 		'email_address' => $regOptions['email'],
591 591
 		'passwd' => hash_password($regOptions['username'], $regOptions['password']),
592
-		'password_salt' => substr(md5(mt_rand()), 0, 4) ,
592
+		'password_salt' => substr(md5(mt_rand()), 0, 4),
593 593
 		'posts' => 0,
594 594
 		'date_registered' => time(),
595 595
 		'member_ip' => $regOptions['interface'] == 'admin' ? '127.0.0.1' : $user_info['ip'],
@@ -679,7 +679,7 @@  discard block
 block discarded – undo
679 679
 		'time_offset',
680 680
 	);
681 681
 	$knownInets = array(
682
-		'member_ip','member_ip2',
682
+		'member_ip', 'member_ip2',
683 683
 	);
684 684
 
685 685
 	// Call an optional function to validate the users' input.
@@ -907,7 +907,7 @@  discard block
 block discarded – undo
907 907
 	$checkName = strtr($name, array('_' => '\\_', '%' => '\\%'));
908 908
 
909 909
 	//when we got no wildcard we can use equal -> fast
910
-	$operator = (strpos($checkName, '%') || strpos($checkName, '_') ? 'LIKE' : '=' );
910
+	$operator = (strpos($checkName, '%') || strpos($checkName, '_') ? 'LIKE' : '=');
911 911
 
912 912
 	// Make sure they don't want someone else's name.
913 913
 	$request = $smcFunc['db_query']('', '
@@ -1276,7 +1276,7 @@  discard block
 block discarded – undo
1276 1276
 		$user_info['buddies'][] = $userReceiver;
1277 1277
 
1278 1278
 		// And add a nice alert. Don't abuse though!
1279
-		if ((cache_get_data('Buddy-sent-'. $user_info['id'] .'-'. $userReceiver, 86400)) == null)
1279
+		if ((cache_get_data('Buddy-sent-' . $user_info['id'] . '-' . $userReceiver, 86400)) == null)
1280 1280
 		{
1281 1281
 			$smcFunc['db_insert']('insert',
1282 1282
 				'{db_prefix}background_tasks',
@@ -1291,7 +1291,7 @@  discard block
 block discarded – undo
1291 1291
 			);
1292 1292
 
1293 1293
 			// Store this in a cache entry to avoid creating multiple alerts. Give it a long life cycle.
1294
-			cache_put_data('Buddy-sent-'. $user_info['id'] .'-'. $userReceiver, '1', 86400);
1294
+			cache_put_data('Buddy-sent-' . $user_info['id'] . '-' . $userReceiver, '1', 86400);
1295 1295
 		}
1296 1296
 	}
1297 1297
 
Please login to merge, or discard this patch.