mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-12-18 02:41:01 +00:00
e614050b6a
Extend Captcha save error handler to verify user using noCaptchaReCaptcha. Bug: T203478 Change-Id: Ia5438bba6ff797dee822caf7664b911f01684744
24 lines
541 B
PHP
24 lines
541 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.google.com/recaptcha/api.js'
|
|
];
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|