Commit 55ebddb5 authored by Evan Prodromou's avatar Evan Prodromou

catch exceptions and show them when validating email

parent dfbb4eaa
......@@ -211,13 +211,18 @@ class EmailregisterAction extends Action
$valid = false;
if (Event::handle('StartValidateUserEmail', array(null, $this->email, &$valid))) {
$valid = Validate::email($this->email, common_config('email', 'check_domain'));
Event::handle('EndValidateUserEmail', array(null, $this->email, &$valid));
}
if (!$valid) {
$this->error = _('Not a valid email address.');
try {
if (Event::handle('StartValidateUserEmail', array(null, $this->email, &$valid))) {
$valid = Validate::email($this->email, common_config('email', 'check_domain'));
Event::handle('EndValidateUserEmail', array(null, $this->email, &$valid));
}
if (!$valid) {
$this->error = _('Not a valid email address.');
$this->showRegistrationForm();
return;
}
} catch (ClientException $e) {
$this->error = $e->getMessage();
$this->showRegistrationForm();
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment