ead0bb46 by Jeff Balicki

se of undefined constant CBV_DOMAIN

1 parent 3429a884
......@@ -240,18 +240,18 @@ class Validation extends Common\Validation {
*/
protected function username($val) {
if (empty($val)) {
throw new Exception('<li>'.__('Username is blank', CBV_DOMAIN).'</li>');
throw new Exception('<li>'.__('Username is blank', 'CBV_DOMAIN').'</li>');
}
require_once(ABSPATH . WPINC . DIRECTORY_SEPARATOR . 'registration.php');
if (!validate_username($val)) {
throw new Exception(
'<li>'.__('Username must be at least 4 characters, letters and numbers only', CBV_DOMAIN).'</li>'
'<li>'.__('Username must be at least 4 characters, letters and numbers only', 'CBV_DOMAIN').'</li>'
);
}
if (username_exists($val)) {
throw new Exception('<li>'.__('Username already exists', CBV_DOMAIN).'</li>');
throw new Exception('<li>'.__('Username already exists', 'CBV_DOMAIN').'</li>');
}
}
......@@ -262,18 +262,18 @@ class Validation extends Common\Validation {
*/
protected function password($val) {
if (empty($val)) {
throw new Exception('<li>'.__('Password can not be blank', CBV_DOMAIN).'</li>');
throw new Exception('<li>'.__('Password can not be blank', 'CBV_DOMAIN').'</li>');
}
if (isset($val[PASS_MAX_LEN])) {
throw new Exception(
'<li>'.sprintf(__('Password can not be longer than %d characters.', CBV_DOMAIN), PASS_MAX_LEN).'</li>'
'<li>'.sprintf(__('Password can not be longer than %d characters.', 'CBV_DOMAIN'), PASS_MAX_LEN).'</li>'
);
}
if (preg_match('/(\\\\|\\\'|"| )+/i', $val)) {
throw new Exception(
'<li>'.__('Password can not contain spaces, backslashes (\) or quotes', CBV_DOMAIN).'</li>'
'<li>'.__('Password can not contain spaces, backslashes (\) or quotes', 'CBV_DOMAIN').'</li>'
);
}
}
......@@ -284,11 +284,11 @@ class Validation extends Common\Validation {
*/
protected function email($val) {
if (!(boolean)filter_var($val, FILTER_VALIDATE_EMAIL)) {
throw new Exception('<li>'.__('Invalid email address', CBV_DOMAIN).'</li>');
throw new Exception('<li>'.__('Invalid email address', 'CBV_DOMAIN').'</li>');
}
if (false !== email_exists($val)) {
throw new Exception('<li>'.__('Email address already registered', CBV_DOMAIN).' </li > ');
throw new Exception('<li>'.__('Email address already registered', 'CBV_DOMAIN').' </li > ');
}
}
}
......