mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-27 09:30:06 +00:00
Merge "Replace global configuration variables by Config"
This commit is contained in:
commit
428812edb2
|
@ -14,12 +14,9 @@ class Hooks implements ResourceLoaderGetConfigVarsHook {
|
|||
* @param Config $config
|
||||
*/
|
||||
public function onResourceLoaderGetConfigVars( array &$vars, $skin, Config $config ): void {
|
||||
global $wgReCaptchaSiteKey;
|
||||
global $wgCaptchaClass;
|
||||
|
||||
if ( $wgCaptchaClass === ReCaptchaNoCaptcha::class ) {
|
||||
if ( $config->get( 'CaptchaClass' ) === ReCaptchaNoCaptcha::class ) {
|
||||
$vars['wgConfirmEditConfig'] = [
|
||||
'reCaptchaSiteKey' => $wgReCaptchaSiteKey,
|
||||
'reCaptchaSiteKey' => $config->get( 'ReCaptchaSiteKey' ),
|
||||
'reCaptchaScriptURL' => 'https://www.recaptcha.net/recaptcha/api.js'
|
||||
];
|
||||
}
|
||||
|
|
|
@ -14,12 +14,9 @@ class Hooks implements ResourceLoaderGetConfigVarsHook {
|
|||
* @param Config $config
|
||||
*/
|
||||
public function onResourceLoaderGetConfigVars( array &$vars, $skin, Config $config ): void {
|
||||
global $wgTurnstileSiteKey;
|
||||
global $wgCaptchaClass;
|
||||
|
||||
if ( $wgCaptchaClass === Turnstile::class ) {
|
||||
if ( $config->get( 'CaptchaClass' ) === Turnstile::class ) {
|
||||
$vars['wgConfirmEditConfig'] = [
|
||||
'turnstileSiteKey' => $wgTurnstileSiteKey,
|
||||
'turnstileSiteKey' => $config->get( 'TurnstileSiteKey' ),
|
||||
'turnstileScriptURL' => 'https://challenges.cloudflare.com/turnstile/v0/api.js'
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue