Не отрабатывает проверка на незаполненность.

This commit is contained in:
lopar 2020-08-27 20:14:31 +03:00
parent 4d99a5bcad
commit 588f189f89

View File

@ -22,8 +22,8 @@ function mail_send($to, $from_user, $from_email, $subject = '(No subject)', $mes
$login = filter_input(INPUT_POST, 'loginid', FILTER_SANITIZE_SPECIAL_CHARS); $login = filter_input(INPUT_POST, 'loginid', FILTER_SANITIZE_SPECIAL_CHARS);
if ($login) { if ($login) {
$recovery = db::c()->query('SELECT 1 FROM users_recovery WHERE login = "?s"', $login); $recovery = db::c()->query('SELECT 1 FROM users_recovery WHERE login = "?s"', $login)->getNumRows() ?? 0;
if (!empty($recovery->getNumRows())) { if ($recovery) {
$sql = db::c()->query('SELECT email FROM users WHERE login = "?s"', $login)->fetch_assoc(); $sql = db::c()->query('SELECT email FROM users WHERE login = "?s"', $login)->fetch_assoc();
if ($sql) { if ($sql) {
$hash = bin2hex(random_bytes(8)); $hash = bin2hex(random_bytes(8));