2018-12-07 20:44:46 +00:00
|
|
|
<?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;
|
|
|
|
|
2022-12-13 20:42:56 +00:00
|
|
|
if ( $wgCaptchaClass === ReCaptchaNoCaptcha::class ) {
|
2018-12-07 20:44:46 +00:00
|
|
|
$vars['wgConfirmEditConfig'] = [
|
|
|
|
'reCaptchaSiteKey' => $wgReCaptchaSiteKey,
|
2020-04-17 15:18:38 +00:00
|
|
|
'reCaptchaScriptURL' => 'https://www.recaptcha.net/recaptcha/api.js'
|
2018-12-07 20:44:46 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|