From: Tim Düsterhus Date: Sun, 17 Feb 2013 14:41:35 +0000 (+0100) Subject: Disallow usernames with more than 255 characters X-Git-Tag: 2.0.0_Beta_1~472 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=988e0beb1a856a268a9ec544adb344f06a929102;p=GitHub%2FWoltLab%2FWCF.git Disallow usernames with more than 255 characters SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'username' at row 1 --- diff --git a/wcfsetup/install/files/lib/util/UserUtil.class.php b/wcfsetup/install/files/lib/util/UserUtil.class.php index c3554e2b47..116ed6ee0f 100644 --- a/wcfsetup/install/files/lib/util/UserUtil.class.php +++ b/wcfsetup/install/files/lib/util/UserUtil.class.php @@ -20,8 +20,8 @@ final class UserUtil { * @return boolean */ public static function isValidUsername($name) { - // minimum length are 3 characters - if (StringUtil::length($name) < 3) { + // minimum length is 3 characters, maximum length is 255 characters + if (StringUtil::length($name) < 3 || StringUtil::length($name) > 255) { return false; }