Update Validators\Email
email_normal is not evaluated when email is set. loadByEmail() will not throw an exception, since the email_normal field contains a unique index.
This commit is contained in:
parent
bd67fc9796
commit
f634b37ee2
1 changed files with 3 additions and 3 deletions
|
@ -47,7 +47,7 @@ class Email extends RulesValidator
|
|||
$attrs = \array_flip(\explode(',', $attrs));
|
||||
$ok = true;
|
||||
$user = $this->c->users->create();
|
||||
$user->__email = $email; // + вычисление email_normal
|
||||
$user->__email = $email;
|
||||
|
||||
// провеерка бана email
|
||||
if (
|
||||
|
@ -63,7 +63,7 @@ class Email extends RulesValidator
|
|||
$ok
|
||||
&& isset($attrs['exists'])
|
||||
) {
|
||||
$user = $this->c->users->loadByEmail($email); // ???? перехват исключения?
|
||||
$user = $this->c->users->loadByEmail($email);
|
||||
|
||||
if (! $user instanceof User) {
|
||||
$v->addError('Invalid email');
|
||||
|
@ -80,7 +80,7 @@ class Email extends RulesValidator
|
|||
)
|
||||
) {
|
||||
if ($user->isGuest) {
|
||||
$user = $this->c->users->loadByEmail($email); // ???? перехват исключения?
|
||||
$user = $this->c->users->loadByEmail($email);
|
||||
}
|
||||
|
||||
if (
|
||||
|
|
Loading…
Add table
Reference in a new issue