Skip to content

Commit 7b2d1ac

Browse files
mikoczymarkoph
authored andcommitted
Removed LOWER() from email check
MySQL is case insensitive. And when LOWER is used, MySQL will not use the email index. #14
1 parent a424474 commit 7b2d1ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/model/Builder/UserBuilder.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function isValid()
4242
if (strlen($this->get('email')) < 1) {
4343
$this->addError('Nebol zadaný email');
4444
}
45-
$user = $this->database->table($this->tableName)->where(['LOWER(email)' => strtolower($this->get('email'))])->fetch();
45+
$user = $this->database->table($this->tableName)->where(['email' => $this->get('email')])->fetch();
4646
if ($user) {
4747
$this->addError("Email '{$this->get('email')}' je už registrovaný");
4848
}

0 commit comments

Comments
 (0)