aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_user.php
diff options
context:
space:
mode:
author3D-I <marktravai@gmail.com>2019-03-31 07:20:59 +0200
committer3D-I <marktravai@gmail.com>2019-03-31 07:21:44 +0200
commit5bd2c067c5540bd68ae3d56c927c9ebb441243ac (patch)
tree0659946f0014da362503ac8232974f5bf1f5076e /phpBB/includes/functions_user.php
parentdc80ffdb40472fa9344765162c9d21d57f270de0 (diff)
downloadforums-5bd2c067c5540bd68ae3d56c927c9ebb441243ac.tar
forums-5bd2c067c5540bd68ae3d56c927c9ebb441243ac.tar.gz
forums-5bd2c067c5540bd68ae3d56c927c9ebb441243ac.tar.bz2
forums-5bd2c067c5540bd68ae3d56c927c9ebb441243ac.tar.xz
forums-5bd2c067c5540bd68ae3d56c927c9ebb441243ac.zip
[ticket/16004] Move the check-in to a more appropriated place
PHPBB3-16004
Diffstat (limited to 'phpBB/includes/functions_user.php')
-rw-r--r--phpBB/includes/functions_user.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 5789981429..99d04d5b2a 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -1709,6 +1709,14 @@ function validate_username($username, $allowed_username = false)
return false;
}
+ // The very first check is for
+ // out-of-bounds characters that are currently
+ // not supported by utf8_bin in MySQL
+ if (preg_match('/[\x{10000}-\x{10FFFF}]/u', $username))
+ {
+ return 'INVALID_EMOJIS_USERNAME';
+ }
+
// ... fast checks first.
if (strpos($username, '&quot;') !== false || strpos($username, '"') !== false || empty($clean_username))
{
@@ -1760,13 +1768,6 @@ function validate_username($username, $allowed_username = false)
return 'USERNAME_TAKEN';
}
- // Check for out-of-bounds characters that are currently
- // not supported by utf8_bin in MySQL
- if (preg_match('/[\x{10000}-\x{10FFFF}]/u', $username))
- {
- return 'INVALID_EMOJIS_USERNAME';
- }
-
$sql = 'SELECT group_name
FROM ' . GROUPS_TABLE . "
WHERE LOWER(group_name) = '" . $db->sql_escape(utf8_strtolower($username)) . "'";