aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
author3D-I <marktravai@gmail.com>2019-03-31 07:08:20 +0200
committer3D-I <marktravai@gmail.com>2019-03-31 07:08:26 +0200
commitdc80ffdb40472fa9344765162c9d21d57f270de0 (patch)
tree30397a98129bfa62b48417b5ef6d90cab8d798a4 /phpBB
parente6ac4daf64a0671f21166708045a74ae59f5f048 (diff)
downloadforums-dc80ffdb40472fa9344765162c9d21d57f270de0.tar
forums-dc80ffdb40472fa9344765162c9d21d57f270de0.tar.gz
forums-dc80ffdb40472fa9344765162c9d21d57f270de0.tar.bz2
forums-dc80ffdb40472fa9344765162c9d21d57f270de0.tar.xz
forums-dc80ffdb40472fa9344765162c9d21d57f270de0.zip
[ticket/16004] Add check-in for Emojis in Username
PHPBB3-16004
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/functions_user.php7
-rw-r--r--phpBB/language/en/ucp.php1
2 files changed, 8 insertions, 0 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index d019b867fa..5789981429 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -1760,6 +1760,13 @@ 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)) . "'";
diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php
index 5875099fb8..a4e834cb85 100644
--- a/phpBB/language/en/ucp.php
+++ b/phpBB/language/en/ucp.php
@@ -272,6 +272,7 @@ $lang = array_merge($lang, array(
'IMPORTANT_NEWS' => 'Important announcements',
'INVALID_USER_BIRTHDAY' => 'The entered birthday is not a valid date.',
'INVALID_CHARS_USERNAME' => 'The username contains forbidden characters.',
+ 'INVALID_EMOJIS_USERNAME' => 'The username contains forbidden characters (Emoji).',
'INVALID_CHARS_NEW_PASSWORD'=> 'The password does not contain the required characters.',
'ITEMS_REQUIRED' => 'The items marked with * are required profile fields and need to be filled out.',