FIX possibility to bypass captcha if it has been validated otherwise

This commit is contained in:
Regis Houssin 2019-08-30 20:20:54 +02:00
parent 8eae59945d
commit abb0a681fc

View File

@ -491,7 +491,7 @@ if (! defined('NOLOGIN'))
} }
// Verification security graphic code // Verification security graphic code
if (GETPOST("username", "alpha", 2) && ! empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA)) if (GETPOST("username", "alpha", 2) && ! empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA) && ! isset($_SESSION['dol_bypass_antispam']))
{ {
$sessionkey = 'dol_antispam_value'; $sessionkey = 'dol_antispam_value';
$ok=(array_key_exists($sessionkey, $_SESSION) === true && (strtolower($_SESSION[$sessionkey]) == strtolower($_POST['code']))); $ok=(array_key_exists($sessionkey, $_SESSION) === true && (strtolower($_SESSION[$sessionkey]) == strtolower($_POST['code'])));