mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-12-04 04:28:30 +00:00
a0feac27b0
Change-Id: I2933639f9cb50db2101c4765ce9d8f9069d253b8
26 lines
594 B
PHP
26 lines
594 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\ConfirmEdit\ReCaptchaNoCaptcha;
|
|
|
|
class Hooks {
|
|
/**
|
|
* 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;
|
|
}
|
|
}
|