check email/username syntax before sending it to db
All checks were successful
mapguesser/pipeline/pr-develop This commit looks good
All checks were successful
mapguesser/pipeline/pr-develop This commit looks good
This commit is contained in:
parent
2177dfd893
commit
0a7d248a3e
@ -157,6 +157,13 @@ class LoginController
|
||||
return new JsonContent(['success' => true]);
|
||||
}
|
||||
|
||||
if (
|
||||
filter_var(\Container::$request->post('email'), FILTER_VALIDATE_EMAIL) === false &&
|
||||
preg_match('/^[a-zA-Z0-9_\-\.]+$/', \Container::$request->post('email')) !== 1
|
||||
) {
|
||||
return new JsonContent(['error' => ['errorText' => 'This is not a valid email address or username.']]);
|
||||
}
|
||||
|
||||
$user = $this->userRepository->getByEmailOrUsername(\Container::$request->post('email'));
|
||||
|
||||
if ($user === null) {
|
||||
@ -500,6 +507,13 @@ class LoginController
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
filter_var(\Container::$request->post('email'), FILTER_VALIDATE_EMAIL) === false &&
|
||||
preg_match('/^[a-zA-Z0-9_\-\.]+$/', \Container::$request->post('email')) !== 1
|
||||
) {
|
||||
return new JsonContent(['error' => ['errorText' => 'This is not a valid email address or username.']]);
|
||||
}
|
||||
|
||||
$user = $this->userRepository->getByEmailOrUsername(\Container::$request->post('email'));
|
||||
|
||||
if ($user === null) {
|
||||
|
Loading…
Reference in New Issue
Block a user