mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-24 00:04:15 +00:00
0b0f9e37af
Bug: T269882 Change-Id: I91df459f696e99bb5cce597739b48cbebbf4a88e
28 lines
744 B
PHP
28 lines
744 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\ConfirmEdit\ReCaptchaNoCaptcha;
|
|
|
|
use 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 {
|
|
global $wgReCaptchaSiteKey;
|
|
global $wgCaptchaClass;
|
|
|
|
if ( $wgCaptchaClass === ReCaptchaNoCaptcha::class ) {
|
|
$vars['wgConfirmEditConfig'] = [
|
|
'reCaptchaSiteKey' => $wgReCaptchaSiteKey,
|
|
'reCaptchaScriptURL' => 'https://www.recaptcha.net/recaptcha/api.js'
|
|
];
|
|
}
|
|
}
|
|
}
|