|
@@ -467,7 +467,9 @@ |
|
|
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) |
|
|
471
|
+ { |
|
|
472
|
+return $smcFunc['htmlspecialchars']($name[0]);}, $regOptions['username']) : $regOptions['username']; |
|
471
|
473
|
|
|
472
|
474
|
// @todo Separate the sprintf? |
|
473
|
475
|
if (empty($regOptions['email']) || !filter_var($regOptions['email'], FILTER_VALIDATE_EMAIL) || strlen($regOptions['email']) > 255) |
Please login to merge, or discard this patch.