ConfirmEdit: Cleaning up brain-damaged implementation of keyMatch() which expected...
[toast/cookiecaptcha.git] / ConfirmEdit_body.php
index 8e67910e920f35d2a86c1ecf50842233f0a81533..1755183a14eaa3f7307133277c4574da9553390d 100644 (file)
@@ -44,7 +44,7 @@ class ConfirmEditHooks {
        }
 }
 
-class CaptchaSpecialPage extends SpecialPage {
+class CaptchaSpecialPage extends UnlistedSpecialPage {
        function execute( $par ) {
                $this->setHeaders();
                $instance = ConfirmEditHooks::getInstance();
@@ -206,12 +206,12 @@ class SimpleCaptcha {
         *
         * 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'];
        }
 
        // ----------------------------------
@@ -508,7 +508,7 @@ class SimpleCaptcha {
                $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;