[Corrección] considera cuando el token no existe en un formulario

This commit is contained in:
Ricardo García Jiménez 2021-09-24 19:03:45 -05:00
parent d8494912dd
commit 970878e8be

View file

@ -32,7 +32,7 @@ class csrf {
// Valida si un token no está expirado y es igual al generado.
public static function validate($token2) {
if (empty($_SESSION['csrf'])) {
if (empty($_SESSION['csrf']) || empty($token2)) {
self::errors('Token inválido');
}