mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-12-18 19:02:00 +00:00
9f2e976f10
In an attempt to be able to have easier code coverage... Bug: T377750 Change-Id: I556f5f2753fae77df4f34b64bccdb7d68f2825b0
25 lines
734 B
PHP
25 lines
734 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\ConfirmEdit\ReCaptchaNoCaptcha;
|
|
|
|
use MediaWiki\Config\Config;
|
|
use MediaWiki\ResourceLoader\Hook\ResourceLoaderGetConfigVarsHook;
|
|
|
|
class Hooks implements ResourceLoaderGetConfigVarsHook {
|
|
/**
|
|
* Adds extra variables to the global config
|
|
*
|
|
* @param array &$vars Global variables object
|
|
* @param string $skin
|
|
* @param Config $config
|
|
*/
|
|
public function onResourceLoaderGetConfigVars( array &$vars, $skin, Config $config ): void {
|
|
if ( $config->get( 'CaptchaClass' ) === ReCaptchaNoCaptcha::class ) {
|
|
$vars['wgConfirmEditConfig'] = [
|
|
'reCaptchaSiteKey' => $config->get( 'ReCaptchaSiteKey' ),
|
|
'reCaptchaScriptURL' => 'https://www.recaptcha.net/recaptcha/api.js'
|
|
];
|
|
}
|
|
}
|
|
}
|