Index: trunk/extensions/ConfirmEdit/ConfirmEdit_body.php |
— | — | @@ -206,12 +206,12 @@ |
207 | 207 | * |
208 | 208 | * Override this! |
209 | 209 | * |
210 | | - * @param WebRequest $request |
| 210 | + * @param string $answer |
211 | 211 | * @param array $info |
212 | 212 | * @return bool |
213 | 213 | */ |
214 | | - function keyMatch( $request, $info ) { |
215 | | - return $request->getVal( 'wpCaptchaWord' ) == $info['answer']; |
| 214 | + function keyMatch( $answer, $info ) { |
| 215 | + return $answer == $info['answer']; |
216 | 216 | } |
217 | 217 | |
218 | 218 | // ---------------------------------- |
— | — | @@ -508,7 +508,7 @@ |
509 | 509 | $info = $this->retrieveCaptcha(); |
510 | 510 | if( $info ) { |
511 | 511 | global $wgRequest; |
512 | | - if( $this->keyMatch( $wgRequest, $info ) ) { |
| 512 | + if( $this->keyMatch( $wgRequest->getVal('wpCaptchaWord'), $info ) ) { |
513 | 513 | $this->log( "passed" ); |
514 | 514 | $this->clearCaptcha( $info ); |
515 | 515 | return true; |
Index: trunk/extensions/ConfirmEdit/MathCaptcha.class.php |
— | — | @@ -3,8 +3,8 @@ |
4 | 4 | class MathCaptcha extends SimpleCaptcha { |
5 | 5 | |
6 | 6 | /** Validate a captcha response */ |
7 | | - function keyMatch( $req, $info ) { |
8 | | - return (int)$req->getVal( 'wpCaptchaAnswer' ) == (int)$info['answer']; |
| 7 | + function keyMatch( $answer, $info ) { |
| 8 | + return (int)$answer == (int)$info['answer']; |
9 | 9 | } |
10 | 10 | |
11 | 11 | /** Produce a nice little form */ |
Index: trunk/extensions/ConfirmEdit/FancyCaptcha.class.php |
— | — | @@ -5,14 +5,13 @@ |
6 | 6 | * Check if the submitted form matches the captcha session data provided |
7 | 7 | * by the plugin when the form was generated. |
8 | 8 | * |
9 | | - * @param WebRequest $request |
| 9 | + * @param string $answer |
10 | 10 | * @param array $info |
11 | 11 | * @return bool |
12 | 12 | */ |
13 | | - function keyMatch( $request, $info ) { |
| 13 | + function keyMatch( $answer, $info ) { |
14 | 14 | global $wgCaptchaSecret; |
15 | 15 | |
16 | | - $answer = $request->getVal( 'wpCaptchaWord' ); |
17 | 16 | $digest = $wgCaptchaSecret . $info['salt'] . $answer . $wgCaptchaSecret . $info['salt']; |
18 | 17 | $answerHash = substr( md5( $digest ), 0, 16 ); |
19 | 18 | |