*
* Override this!
*
- * @param WebRequest $request
+ * @param string $answer
* @param array $info
* @return bool
*/
- function keyMatch( $request, $info ) {
- return $request->getVal( 'wpCaptchaWord' ) == $info['answer'];
+ function keyMatch( $answer, $info ) {
+ return $answer == $info['answer'];
}
// ----------------------------------
$info = $this->retrieveCaptcha();
if( $info ) {
global $wgRequest;
- if( $this->keyMatch( $wgRequest, $info ) ) {
+ if( $this->keyMatch( $wgRequest->getVal('wpCaptchaWord'), $info ) ) {
$this->log( "passed" );
$this->clearCaptcha( $info );
return true;
* Check if the submitted form matches the captcha session data provided
* by the plugin when the form was generated.
*
- * @param WebRequest $request
+ * @param string $answer
* @param array $info
* @return bool
*/
- function keyMatch( $request, $info ) {
+ function keyMatch( $answer, $info ) {
global $wgCaptchaSecret;
- $answer = $request->getVal( 'wpCaptchaWord' );
$digest = $wgCaptchaSecret . $info['salt'] . $answer . $wgCaptchaSecret . $info['salt'];
$answerHash = substr( md5( $digest ), 0, 16 );
class MathCaptcha extends SimpleCaptcha {
/** Validate a captcha response */
- function keyMatch( $req, $info ) {
- return (int)$req->getVal( 'wpCaptchaAnswer' ) == (int)$info['answer'];
+ function keyMatch( $answer, $info ) {
+ return (int)$answer == (int)$info['answer'];
}
/** Produce a nice little form */