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

This commit is contained in:
lopar 2020-08-27 20:11:31 +03:00
parent 7ed294e4e5
commit 4d99a5bcad

View File

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