mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-28 18:10:16 +00:00
5f24bff3f4
Bug: T250297 Change-Id: I05bb74e65ce9ce425a7a4fecd33a75748ef6cc43
24 lines
544 B
PHP
24 lines
544 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' ) {
|
|
$vars['wgConfirmEditConfig'] = [
|
|
'reCaptchaSiteKey' => $wgReCaptchaSiteKey,
|
|
'reCaptchaScriptURL' => 'https://www.recaptcha.net/recaptcha/api.js'
|
|
];
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|