mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-27 17:40:11 +00:00
Replace $wgOut with RequestContext::getMain()
Bug: T252978 Change-Id: I5e677fde89accfa6363824ef4cbd8808097e00f3
This commit is contained in:
parent
52af58f4b8
commit
c9511bb825
|
@ -15,6 +15,7 @@ use MediaWiki\WikiMap\WikiMap;
|
||||||
use MWTimestamp;
|
use MWTimestamp;
|
||||||
use NullLockManager;
|
use NullLockManager;
|
||||||
use ObjectCache;
|
use ObjectCache;
|
||||||
|
use RequestContext;
|
||||||
use SpecialPage;
|
use SpecialPage;
|
||||||
use StatusValue;
|
use StatusValue;
|
||||||
use UnderflowException;
|
use UnderflowException;
|
||||||
|
@ -382,11 +383,10 @@ class FancyCaptcha extends SimpleCaptcha {
|
||||||
* @return bool|StatusValue
|
* @return bool|StatusValue
|
||||||
*/
|
*/
|
||||||
public function showImage() {
|
public function showImage() {
|
||||||
global $wgOut, $wgRequest;
|
$context = RequestContext::getMain();
|
||||||
|
$context->getOutput()->disable();
|
||||||
|
|
||||||
$wgOut->disable();
|
$index = $context->getRequest()->getVal( 'wpCaptchaId' );
|
||||||
|
|
||||||
$index = $wgRequest->getVal( 'wpCaptchaId' );
|
|
||||||
$info = $this->retrieveCaptcha( $index );
|
$info = $this->retrieveCaptcha( $index );
|
||||||
if ( $info ) {
|
if ( $info ) {
|
||||||
$timestamp = new MWTimestamp();
|
$timestamp = new MWTimestamp();
|
||||||
|
|
|
@ -15,6 +15,7 @@ use MediaWiki\Auth\AuthenticationRequest;
|
||||||
use MediaWiki\Extension\ConfirmEdit\Auth\CaptchaAuthenticationRequest;
|
use MediaWiki\Extension\ConfirmEdit\Auth\CaptchaAuthenticationRequest;
|
||||||
use MediaWiki\Extension\ConfirmEdit\SimpleCaptcha\SimpleCaptcha;
|
use MediaWiki\Extension\ConfirmEdit\SimpleCaptcha\SimpleCaptcha;
|
||||||
use MediaWiki\Extension\ConfirmEdit\Store\CaptchaStore;
|
use MediaWiki\Extension\ConfirmEdit\Store\CaptchaStore;
|
||||||
|
use RequestContext;
|
||||||
use Xml;
|
use Xml;
|
||||||
|
|
||||||
class QuestyCaptcha extends SimpleCaptcha {
|
class QuestyCaptcha extends SimpleCaptcha {
|
||||||
|
@ -106,11 +107,12 @@ class QuestyCaptcha extends SimpleCaptcha {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function showHelp() {
|
public function showHelp() {
|
||||||
global $wgOut;
|
$context = RequestContext::getMain();
|
||||||
$wgOut->setPageTitle( wfMessage( 'captchahelp-title' )->text() );
|
$out = $context->getOutput();
|
||||||
$wgOut->addWikiMsg( 'questycaptchahelp-text' );
|
$out->setPageTitle( $context->msg( 'captchahelp-title' )->text() );
|
||||||
|
$out->addWikiMsg( 'questycaptchahelp-text' );
|
||||||
if ( CaptchaStore::get()->cookiesNeeded() ) {
|
if ( CaptchaStore::get()->cookiesNeeded() ) {
|
||||||
$wgOut->addWikiMsg( 'captchahelp-cookies-needed' );
|
$out->addWikiMsg( 'captchahelp-cookies-needed' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1197,11 +1197,12 @@ class SimpleCaptcha {
|
||||||
* Show a page explaining what this wacky thing is.
|
* Show a page explaining what this wacky thing is.
|
||||||
*/
|
*/
|
||||||
public function showHelp() {
|
public function showHelp() {
|
||||||
global $wgOut;
|
$context = RequestContext::getMain();
|
||||||
$wgOut->setPageTitle( wfMessage( 'captchahelp-title' )->text() );
|
$out = $context->getOutput();
|
||||||
$wgOut->addWikiMsg( 'captchahelp-text' );
|
$out->setPageTitle( $context->msg( 'captchahelp-title' )->text() );
|
||||||
|
$out->addWikiMsg( 'captchahelp-text' );
|
||||||
if ( CaptchaStore::get()->cookiesNeeded() ) {
|
if ( CaptchaStore::get()->cookiesNeeded() ) {
|
||||||
$wgOut->addWikiMsg( 'captchahelp-cookies-needed' );
|
$out->addWikiMsg( 'captchahelp-cookies-needed' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue