Alex Monk has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/251672

Change subject: Copy context request changes to wgRequest global
......................................................................

Copy context request changes to wgRequest global

I wanted to pass a WebRequest object around but that'll probably
break external captcha plugins?

Bug: T118052
Change-Id: I2246e6970b843a4418bf979e9e8b0909f221f1bb
---
M SimpleCaptcha/Captcha.php
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ConfirmEdit 
refs/changes/72/251672/1

diff --git a/SimpleCaptcha/Captcha.php b/SimpleCaptcha/Captcha.php
index d1170ba..1fbe56f 100755
--- a/SimpleCaptcha/Captcha.php
+++ b/SimpleCaptcha/Captcha.php
@@ -575,12 +575,15 @@
         * @return bool false if the CAPTCHA is rejected, true otherwise
         */
        private function doConfirmEdit( WikiPage $page, $newtext, $section, 
IContextSource $context ) {
+               global $wgRequest;
                $request = $context->getRequest();
                if ( $request->getVal( 'captchaid' ) ) {
                        $request->setVal( 'wpCaptchaId', $request->getVal( 
'captchaid' ) );
+                       $wgRequest->setVal( 'wpCaptchaId', $request->getVal( 
'captchaid' ) );
                }
                if ( $request->getVal( 'captchaword' ) ) {
                        $request->setVal( 'wpCaptchaWord', $request->getVal( 
'captchaword' ) );
+                       $wgRequest->setVal( 'wpCaptchaWord', $request->getVal( 
'captchaword' ) );
                }
                if ( $this->shouldCheck( $page, $newtext, $section, $context ) 
) {
                        return $this->passCaptchaLimited();
@@ -856,7 +859,6 @@
 
                $info = $this->retrieveCaptcha( $wgRequest );
                if ( $info ) {
-                       global $wgRequest;
                        if ( $this->keyMatch( $wgRequest->getVal( 
'wpCaptchaWord' ), $info ) ) {
                                $this->log( "passed" );
                                $this->clearCaptcha( $info );

-- 
To view, visit https://gerrit.wikimedia.org/r/251672
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2246e6970b843a4418bf979e9e8b0909f221f1bb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ConfirmEdit
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <kren...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to