recaptcha
Showing
1 changed file
with
9 additions
and
13 deletions
| ... | @@ -196,11 +196,7 @@ function activate($key, $password_validation = null) { | ... | @@ -196,11 +196,7 @@ function activate($key, $password_validation = null) { |
| 196 | // Do I need to re-sanatize this? | 196 | // Do I need to re-sanatize this? |
| 197 | $meta = unserialize($signup->meta); | 197 | $meta = unserialize($signup->meta); |
| 198 | 198 | ||
| 199 | if (!is_null($password_validation)) { | 199 | |
| 200 | if ($meta['password'] != $password_validation) { | ||
| 201 | throw new Exception('Bad password match'); | ||
| 202 | } | ||
| 203 | } | ||
| 204 | 200 | ||
| 205 | $id = _create_user($signup->user_login, $meta['password'], $signup->user_email); | 201 | $id = _create_user($signup->user_login, $meta['password'], $signup->user_email); |
| 206 | unset($meta['password']); | 202 | unset($meta['password']); |
| ... | @@ -240,18 +236,18 @@ class Validation extends Common\Validation { | ... | @@ -240,18 +236,18 @@ class Validation extends Common\Validation { |
| 240 | */ | 236 | */ |
| 241 | protected function username($val) { | 237 | protected function username($val) { |
| 242 | if (empty($val)) { | 238 | if (empty($val)) { |
| 243 | throw new Exception('<li>'.__('Username is blank', CBV_DOMAIN).'</li>'); | 239 | throw new Exception('<li>'.__('Username is blank', 'cicbv-front-end').'</li>'); |
| 244 | } | 240 | } |
| 245 | 241 | ||
| 246 | require_once(ABSPATH . WPINC . DIRECTORY_SEPARATOR . 'registration.php'); | 242 | require_once(ABSPATH . WPINC . DIRECTORY_SEPARATOR . 'registration.php'); |
| 247 | if (!validate_username($val)) { | 243 | if (!validate_username($val)) { |
| 248 | throw new Exception( | 244 | throw new Exception( |
| 249 | '<li>'.__('Username must be at least 4 characters, letters and numbers only', CBV_DOMAIN).'</li>' | 245 | '<li>'.__('Username must be at least 4 characters, letters and numbers only', 'cicbv-front-end').'</li>' |
| 250 | ); | 246 | ); |
| 251 | } | 247 | } |
| 252 | 248 | ||
| 253 | if (username_exists($val)) { | 249 | if (username_exists($val)) { |
| 254 | throw new Exception('<li>'.__('Username already exists', CBV_DOMAIN).'</li>'); | 250 | throw new Exception('<li>'.__('Username already exists', 'cicbv-front-end').'</li>'); |
| 255 | } | 251 | } |
| 256 | } | 252 | } |
| 257 | 253 | ||
| ... | @@ -262,18 +258,18 @@ class Validation extends Common\Validation { | ... | @@ -262,18 +258,18 @@ class Validation extends Common\Validation { |
| 262 | */ | 258 | */ |
| 263 | protected function password($val) { | 259 | protected function password($val) { |
| 264 | if (empty($val)) { | 260 | if (empty($val)) { |
| 265 | throw new Exception('<li>'.__('Password can not be blank', CBV_DOMAIN).'</li>'); | 261 | throw new Exception('<li>'.__('Password can not be blank', 'cicbv-front-end').'</li>'); |
| 266 | } | 262 | } |
| 267 | 263 | ||
| 268 | if (isset($val[PASS_MAX_LEN])) { | 264 | if (isset($val[PASS_MAX_LEN])) { |
| 269 | throw new Exception( | 265 | throw new Exception( |
| 270 | '<li>'.sprintf(__('Password can not be longer than %d characters.', CBV_DOMAIN), PASS_MAX_LEN).'</li>' | 266 | '<li>'.sprintf(__('Password can not be longer than %d characters.', 'cicbv-front-end'), PASS_MAX_LEN).'</li>' |
| 271 | ); | 267 | ); |
| 272 | } | 268 | } |
| 273 | 269 | ||
| 274 | if (preg_match('/(\\\\|\\\'|"| )+/i', $val)) { | 270 | if (preg_match('/(\\\\|\\\'|"| )+/i', $val)) { |
| 275 | throw new Exception( | 271 | throw new Exception( |
| 276 | '<li>'.__('Password can not contain spaces, backslashes (\) or quotes', CBV_DOMAIN).'</li>' | 272 | '<li>'.__('Password can not contain spaces, backslashes (\) or quotes', 'cicbv-front-end').'</li>' |
| 277 | ); | 273 | ); |
| 278 | } | 274 | } |
| 279 | } | 275 | } |
| ... | @@ -284,11 +280,11 @@ class Validation extends Common\Validation { | ... | @@ -284,11 +280,11 @@ class Validation extends Common\Validation { |
| 284 | */ | 280 | */ |
| 285 | protected function email($val) { | 281 | protected function email($val) { |
| 286 | if (!(boolean)filter_var($val, FILTER_VALIDATE_EMAIL)) { | 282 | if (!(boolean)filter_var($val, FILTER_VALIDATE_EMAIL)) { |
| 287 | throw new Exception('<li>'.__('Invalid email address', CBV_DOMAIN).'</li>'); | 283 | throw new Exception('<li>'.__('Invalid email address', 'cicbv-front-end').'</li>'); |
| 288 | } | 284 | } |
| 289 | 285 | ||
| 290 | if (false !== email_exists($val)) { | 286 | if (false !== email_exists($val)) { |
| 291 | throw new Exception('<li>'.__('Email address already registered', CBV_DOMAIN).' </li > '); | 287 | throw new Exception('<li>'.__('Email address already registered', 'cicbv-front-end').' </li > '); |
| 292 | } | 288 | } |
| 293 | } | 289 | } |
| 294 | } | 290 | } | ... | ... |
-
Please register or sign in to post a comment