holyandrew� (holyandrew) wrote in changelog,
holyandrew�
holyandrew
changelog

[livejournal] r23563: LJSUP-14551: Server validation accepts n...

Committer: akanashin
LJSUP-14551: Server validation accepts non-latin chars in username
U   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');
     }

Tags: akanashin, holyandrew, livejournal, pm
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments