Created
September 8, 2013 15:46
-
-
Save joshtronic/6485787 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class user_create extends AnonymousModule | |
{ | |
protected $post = array( | |
'username' => array( | |
'length:>:32' => 'Usernames may not be more than 32 characters.', | |
'regex:/[^a-z0-9-]+/i' => 'Usernames may only contain alphanumeric characters or dashes.', | |
'regex:/^(-.+|.+-)$/' => 'Usernames may not start or end with a dash.', | |
'regex:/-{2,}/' => 'Usernames may not have two or more dashes in a row.', | |
), | |
'email' => array( | |
'filter:validate_email' => 'Your email address is invalid.', | |
), | |
'password' => array( | |
'length:<:8' => 'Passwords may not be less than 8 characters.', | |
), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment