diff options
author | Joe Rayhawk <jrayhawk@omgwallhack.org> | 2011-04-24 13:28:25 -0700 |
---|---|---|
committer | Joe Rayhawk <jrayhawk@omgwallhack.org> | 2011-04-24 13:28:25 -0700 |
commit | 4d19e0af572486ff0cd38b365dfc7411a8207837 (patch) | |
tree | a95b2febbba5a76dedd3ffc421b8f49d36193fa1 /libpiny/lib | |
parent | ffab3ec34b9fd949a9877d0a19182b58911424da (diff) | |
download | piny-code-4d19e0af572486ff0cd38b365dfc7411a8207837.tar.gz piny-code-4d19e0af572486ff0cd38b365dfc7411a8207837.zip |
Adding new <32 character limit to usernames
Diffstat (limited to 'libpiny/lib')
-rw-r--r-- | libpiny/lib/Piny/User.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libpiny/lib/Piny/User.pm b/libpiny/lib/Piny/User.pm index f742f87..90742e7 100644 --- a/libpiny/lib/Piny/User.pm +++ b/libpiny/lib/Piny/User.pm @@ -18,8 +18,8 @@ use Piny::Group; subtype 'Username' => as 'Str' - => where { $_ =~ /^(?!(git|iki)-)[a-zA-Z][a-zA-Z0-9_.-]*$/ } - => message { if ( /^((?:git|iki)-|[^a-zA-Z])/ ) { "Usernames are not allowed to begin with $1" } elsif ( /([^a-zA-Z0-9_.-])/ ) { "Usernames are not allowed to contain $1" } else { "Invalid username" } } + => where { $_ =~ /^(?!(git|iki)-)[a-zA-Z][a-zA-Z0-9_.-]{0,30}$/ } + => message { if ( /^((?:git|iki)-|[^a-zA-Z])/ ) { "Usernames are not allowed to begin with $1" } elsif ( /([^a-zA-Z0-9_.-])/ ) { "Usernames are not allowed to contain $1" } elsif ( /[a-zA-Z0-9_.-]{32,}/ ) { "Usernames are not allowed to be more than 31 bytes" } else { "Invalid username" } } ; # Attributes |