1
uberrookie
max attemps captcha
  • 2011/4/9 19:11

  • uberrookie

  • Just popping in

  • Posts: 34

  • Since: 2011/3/29


xoops 2.5.0
In the function XoopsCaptcha::verify() it says:

} else if (!empty($maxAttempts) && ! empty($_SESSION["{$sessionName}_attempt"]) > $maxAttempts) {
            
$this->message[] = _CAPTCHA_TOOMANYATTEMPTS;
            
// Verify the code
        
}

The result of
(!empty($maxAttempts) && ! empty($_SESSION["{$sessionName}_attempt"])
is either 0 or 1 and never exceeds the $maxAttemps.

Shoudn't it be:
} else if ((!empty($maxAttempts) && ! empty($_SESSION["{$sessionName}_attempt"])) && ($_SESSION["{$sessionName}_attempt"] > $maxAttempts)) {

?