3ab177af by Marty Penner

Modified password validation to reject spaces in passwords. refs #1256

1 parent 31f9d949
......@@ -27,7 +27,7 @@ const OPTION_NAME = 'tz_auth'; // Database lookup key (`wp_options`.`option_name
if (empty($wpdb->signups)) {
$wpdb->signups = $wpdb->prefix . 'signups';
}
//die(var_dump(wp_hash_password('a ')));
Vars::$options = new Tools\WP_Option(OPTION_NAME);
if (is_admin()) {
......@@ -255,12 +255,17 @@ class Validation extends Common\Validation {
/**
* @rule Not blank
* @rule No spaces
* @returns Boolean
*/
protected function password($val) {
if (empty($val)) {
throw new Exception('<li>Password can not be blank</li>');
}
if (false !== strpos($val, ' ')) {
throw new Exception('<li>Password can not contain spaces</li>');
}
}
/**
......