mediawiki-extensions-Confir.../ReCaptchaNoCaptcha/includes/Hooks.php
Umherirrender 92bc1f3d2f Use namespaced classes
Changes to the use statements done automatically via script
Addition of missing use statements done manually

Change-Id: Id44f211320e56bc83e4c8f243369dc4eb562cf37
2023-12-11 00:07:55 +01:00

28 lines
761 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 {
global $wgReCaptchaSiteKey;
global $wgCaptchaClass;
if ( $wgCaptchaClass === ReCaptchaNoCaptcha::class ) {
$vars['wgConfirmEditConfig'] = [
'reCaptchaSiteKey' => $wgReCaptchaSiteKey,
'reCaptchaScriptURL' => 'https://www.recaptcha.net/recaptcha/api.js'
];
}
}
}