Committer: akanashin
LJSUP-14551: Server validation accepts non-latin chars in usernameU trunk/cgi-bin/LJ/CreatePage.pm
Modified: trunk/cgi-bin/LJ/CreatePage.pm =================================================================== --- trunk/cgi-bin/LJ/CreatePage.pm 2013-01-18 12:52:37 UTC (rev 23562) +++ trunk/cgi-bin/LJ/CreatePage.pm 2013-01-18 14:01:47 UTC (rev 23563) @@ -1,6 +1,7 @@ package LJ::CreatePage; use strict; use Carp qw(croak); +use Encode qw(decode_utf8); sub verify_username { my $class = shift; @@ -17,7 +18,7 @@ return $LJ::DISABLED{create_controller} ? LJ::Widget::CreateAccount->ml('widget.createaccount.error.username.mustenter') : LJ::Widget::CreateAccount->ml('createaccount.error.username.mustenter'); } - if (length $given_username > 15) { + if (length Encode::decode_utf8($given_username) > 15) { return $LJ::DISABLED{create_controller} ? LJ::Lang::ml('error.usernamelong') : LJ::Lang::ml('createaccount.error.usernamelong'); }