mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-13 18:07:00 +00:00
Merge "Fix PHP warning when using createaccount API"
This commit is contained in:
commit
9e596aab50
|
@ -1150,7 +1150,8 @@ class SimpleCaptcha {
|
||||||
|
|
||||||
// If we failed a captcha, override the generic 'Warning' result string
|
// If we failed a captcha, override the generic 'Warning' result string
|
||||||
if ( $result['result'] === 'Warning' && isset( $result['warnings'] ) ) {
|
if ( $result['result'] === 'Warning' && isset( $result['warnings'] ) ) {
|
||||||
foreach ( $result['warnings'] as $warning ) {
|
$warnings = ApiResult::stripMetadataNonRecursive( $result['warnings'] );
|
||||||
|
foreach ( $warnings as $warning ) {
|
||||||
if ( $warning['message'] === 'captcha-createaccount-fail' ) {
|
if ( $warning['message'] === 'captcha-createaccount-fail' ) {
|
||||||
$this->addCaptchaAPI( $result );
|
$this->addCaptchaAPI( $result );
|
||||||
$result['result'] = 'NeedCaptcha';
|
$result['result'] = 'NeedCaptcha';
|
||||||
|
@ -1161,6 +1162,8 @@ class SimpleCaptcha {
|
||||||
'event' => 'captcha.display',
|
'event' => 'captcha.display',
|
||||||
'type' => 'accountcreation',
|
'type' => 'accountcreation',
|
||||||
) );
|
) );
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue