mediawiki-extensions-Confir.../ReCaptchaNoCaptcha/includes/ReCaptchaNoCaptchaHooks.php
Reedy 28e07c225e Fix usage of stringified class name
Change-Id: I626a61fd122361dff7ba6e9422f757347090ae41
2022-12-13 20:57:23 +00:00

24 lines
549 B
PHP

<?php
class ReCaptchaNoCaptchaHooks {
/**
* Adds extra variables to the global config
*
* @param array &$vars Global variables object
* @return bool Always true
*/
public static function onResourceLoaderGetConfigVars( array &$vars ) {
global $wgReCaptchaSiteKey;
global $wgCaptchaClass;
if ( $wgCaptchaClass === ReCaptchaNoCaptcha::class ) {
$vars['wgConfirmEditConfig'] = [
'reCaptchaSiteKey' => $wgReCaptchaSiteKey,
'reCaptchaScriptURL' => 'https://www.recaptcha.net/recaptcha/api.js'
];
}
return true;
}
}