Gergő Tisza has uploaded a new change for review.

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

Change subject: Replace passCaptcha with passCaptchaFromRequest
......................................................................

Replace passCaptcha with passCaptchaFromRequest

See I47b2e2fbe3e063cd86e8a2d6bc17ca939472dbe1.

Also replace wfSetupSession while we are at it.

Bug: Bug: T135477
Change-Id: I51915c7a65be61348bb62653292430782500bb42
(cherry picked from commit f39659bad40a1492224265687468acbddcb1c854)
---
M ContactPage_body.php
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContactPage 
refs/changes/27/289327/1

diff --git a/ContactPage_body.php b/ContactPage_body.php
index bd96968..f853716 100644
--- a/ContactPage_body.php
+++ b/ContactPage_body.php
@@ -401,7 +401,7 @@
                }
 
                /* @var SimpleCaptcha $wgCaptcha */
-               if ( $this->useCaptcha() && !$wgCaptcha->passCaptcha() ) {
+               if ( $this->useCaptcha() && 
!$wgCaptcha->passCaptchaFromRequest( $request, $user ) ) {
                        return wfMessage( 'contactpage-captcha-error' 
)->plain();
                }
 
@@ -484,11 +484,11 @@
         */
        private function getCaptcha() {
                // NOTE: make sure we have a session. May be required for 
CAPTCHAs to work.
-               wfSetupSession();
+               
\MediaWiki\Session\SessionManager::getGlobalSession()->persist();
 
                $captcha = ConfirmEditHooks::getInstance();
-               $captcha->trigger = 'contactpage';
-               $captcha->action = 'contact';
+               $captcha->setTrigger( 'contactpage' );
+               $captcha->setAction( 'contact' );
 
                return '<div class="captcha">' .
                        $captcha->getForm( $this->getOutput() ) .

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I51915c7a65be61348bb62653292430782500bb42
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContactPage
Gerrit-Branch: REL1_27
Gerrit-Owner: Gergő Tisza <gti...@wikimedia.org>

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

Reply via email to