diff --git a/ReCaptchaNoCaptcha/includes/ReCaptchaNoCaptchaAuthenticationRequest.php b/ReCaptchaNoCaptcha/includes/ReCaptchaNoCaptchaAuthenticationRequest.php index 01b845dd0..c020f2d8f 100644 --- a/ReCaptchaNoCaptcha/includes/ReCaptchaNoCaptchaAuthenticationRequest.php +++ b/ReCaptchaNoCaptcha/includes/ReCaptchaNoCaptchaAuthenticationRequest.php @@ -8,7 +8,7 @@ use MediaWiki\Auth\AuthenticationRequest; */ class ReCaptchaNoCaptchaAuthenticationRequest extends CaptchaAuthenticationRequest { public function __construct() { - parent::__construct( null, null ); + parent::__construct( '', [] ); } public function loadFromSubmission( array $data ) { diff --git a/SimpleCaptcha/SimpleCaptcha.php b/SimpleCaptcha/SimpleCaptcha.php index 0d9606214..238a23f82 100644 --- a/SimpleCaptcha/SimpleCaptcha.php +++ b/SimpleCaptcha/SimpleCaptcha.php @@ -192,7 +192,7 @@ class SimpleCaptcha { * @return string Description of the captcha. Format is not specified; could be text, HTML, URL... */ public function getCaptchaInfo( $captchaData, $id ) { - return $captchaData['question'] . ' ='; + return array_key_exists( 'question', $captchaData ) ? ( $captchaData['question'] . ' =' ) : ''; } /** diff --git a/includes/auth/CaptchaAuthenticationRequest.php b/includes/auth/CaptchaAuthenticationRequest.php index d19a9dbd9..d3e785442 100644 --- a/includes/auth/CaptchaAuthenticationRequest.php +++ b/includes/auth/CaptchaAuthenticationRequest.php @@ -18,6 +18,10 @@ class CaptchaAuthenticationRequest extends AuthenticationRequest { /** @var string Captcha solution submitted by the user. */ public $captchaWord; + /** + * @param string $id + * @param array $data + */ public function __construct( $id, $data ) { $this->captchaId = $id; $this->captchaData = $data; @@ -83,7 +87,7 @@ class CaptchaAuthenticationRequest extends AuthenticationRequest { } public static function __set_state( $data ) { - $ret = new static( null, null ); + $ret = new static( '', [] ); foreach ( $data as $k => $v ) { $ret->$k = $v; }