2020-04-10 22:21:08 +00:00
|
|
|
<?php
|
|
|
|
|
2022-03-05 15:05:22 +00:00
|
|
|
namespace MediaWiki\Extension\ConfirmEdit\hCaptcha;
|
2020-04-10 22:21:08 +00:00
|
|
|
|
|
|
|
use MediaWiki\Auth\AuthenticationRequest;
|
2022-08-07 20:02:45 +00:00
|
|
|
use MediaWiki\Extension\ConfirmEdit\Auth\CaptchaAuthenticationRequest;
|
2020-04-10 22:21:08 +00:00
|
|
|
|
|
|
|
class HCaptchaAuthenticationRequest extends CaptchaAuthenticationRequest {
|
|
|
|
public function __construct() {
|
|
|
|
parent::__construct( '', [] );
|
|
|
|
}
|
|
|
|
|
2024-10-25 18:24:07 +00:00
|
|
|
/** @inheritDoc */
|
2020-04-10 22:21:08 +00:00
|
|
|
public function loadFromSubmission( array $data ) {
|
|
|
|
// unhack the hack in parent
|
|
|
|
return AuthenticationRequest::loadFromSubmission( $data );
|
|
|
|
}
|
|
|
|
|
2024-10-25 18:24:07 +00:00
|
|
|
/** @inheritDoc */
|
2020-04-10 22:21:08 +00:00
|
|
|
public function getFieldInfo() {
|
|
|
|
$fieldInfo = parent::getFieldInfo();
|
|
|
|
|
|
|
|
return [
|
|
|
|
'captchaWord' => [
|
|
|
|
'type' => 'string',
|
|
|
|
'label' => $fieldInfo['captchaInfo']['label'],
|
|
|
|
'help' => \wfMessage( 'hcaptcha-help' ),
|
|
|
|
],
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|