mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-11 17:00:49 +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 NullLockManager;
|
||||
use ObjectCache;
|
||||
use RequestContext;
|
||||
use SpecialPage;
|
||||
use StatusValue;
|
||||
use UnderflowException;
|
||||
|
@ -382,11 +383,10 @@ class FancyCaptcha extends SimpleCaptcha {
|
|||
* @return bool|StatusValue
|
||||
*/
|
||||
public function showImage() {
|
||||
global $wgOut, $wgRequest;
|
||||
$context = RequestContext::getMain();
|
||||
$context->getOutput()->disable();
|
||||
|
||||
$wgOut->disable();
|
||||
|
||||
$index = $wgRequest->getVal( 'wpCaptchaId' );
|
||||
$index = $context->getRequest()->getVal( 'wpCaptchaId' );
|
||||
$info = $this->retrieveCaptcha( $index );
|
||||
if ( $info ) {
|
||||
$timestamp = new MWTimestamp();
|
||||
|
|
|
@ -15,6 +15,7 @@ use MediaWiki\Auth\AuthenticationRequest;
|
|||
use MediaWiki\Extension\ConfirmEdit\Auth\CaptchaAuthenticationRequest;
|
||||
use MediaWiki\Extension\ConfirmEdit\SimpleCaptcha\SimpleCaptcha;
|
||||
use MediaWiki\Extension\ConfirmEdit\Store\CaptchaStore;
|
||||
use RequestContext;
|
||||
use Xml;
|
||||
|
||||
class QuestyCaptcha extends SimpleCaptcha {
|
||||
|
@ -106,11 +107,12 @@ class QuestyCaptcha extends SimpleCaptcha {
|
|||
}
|
||||
|
||||
public function showHelp() {
|
||||
global $wgOut;
|
||||
$wgOut->setPageTitle( wfMessage( 'captchahelp-title' )->text() );
|
||||
$wgOut->addWikiMsg( 'questycaptchahelp-text' );
|
||||
$context = RequestContext::getMain();
|
||||
$out = $context->getOutput();
|
||||
$out->setPageTitle( $context->msg( 'captchahelp-title' )->text() );
|
||||
$out->addWikiMsg( 'questycaptchahelp-text' );
|
||||
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.
|
||||
*/
|
||||
public function showHelp() {
|
||||
global $wgOut;
|
||||
$wgOut->setPageTitle( wfMessage( 'captchahelp-title' )->text() );
|
||||
$wgOut->addWikiMsg( 'captchahelp-text' );
|
||||
$context = RequestContext::getMain();
|
||||
$out = $context->getOutput();
|
||||
$out->setPageTitle( $context->msg( 'captchahelp-title' )->text() );
|
||||
$out->addWikiMsg( 'captchahelp-text' );
|
||||
if ( CaptchaStore::get()->cookiesNeeded() ) {
|
||||
$wgOut->addWikiMsg( 'captchahelp-cookies-needed' );
|
||||
$out->addWikiMsg( 'captchahelp-cookies-needed' );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue