Merge "Turnstile: Minor cleanup"

This commit is contained in:
jenkins-bot 2024-01-19 11:05:08 +00:00 committed by Gerrit Code Review
commit 3935691f2f
3 changed files with 6 additions and 7 deletions

View file

@ -49,13 +49,12 @@ class HTMLTurnstileField extends HTMLFormField {
);
Turnstile::addCSPSources( $out->getCSP() );
$output = Html::element( 'div', [
return Html::element( 'div', [
'class' => [
'cf-turnstile',
'mw-confirmedit-captcha-fail' => (bool)$this->error,
],
'data-sitekey' => $this->key,
] );
return $output;
}
}

View file

@ -2,7 +2,7 @@
namespace MediaWiki\Extension\ConfirmEdit\Turnstile;
use Config;
use MediaWiki\Config\Config;
use MediaWiki\ResourceLoader\Hook\ResourceLoaderGetConfigVarsHook;
class Hooks implements ResourceLoaderGetConfigVarsHook {

View file

@ -246,9 +246,9 @@ class Turnstile extends SimpleCaptcha {
$captcha = Hooks::getInstance();
$formDescriptor['captchaWord'] = [
'class' => HTMLTurnstileField::class,
'key' => $wgTurnstileSiteKey,
'error' => $captcha->getError(),
] + $formDescriptor['captchaWord'];
'class' => HTMLTurnstileField::class,
'key' => $wgTurnstileSiteKey,
'error' => $captcha->getError(),
] + $formDescriptor['captchaWord'];
}
}