Skip to content

Instantly share code, notes, and snippets.

@joshtronic
Created September 8, 2013 15:46
Show Gist options
  • Save joshtronic/6485787 to your computer and use it in GitHub Desktop.
Save joshtronic/6485787 to your computer and use it in GitHub Desktop.
<?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