Gergő Tisza has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/285458

Change subject: Fix PHP warning when using createaccount API
......................................................................

Fix PHP warning when using createaccount API

Change-Id: I5975c34be4fc11af8dcdd394c0c6605e72f13582
---
M SimpleCaptcha/Captcha.php
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ConfirmEdit 
refs/changes/58/285458/1

diff --git a/SimpleCaptcha/Captcha.php b/SimpleCaptcha/Captcha.php
index 7697ab7..4f010af 100755
--- a/SimpleCaptcha/Captcha.php
+++ b/SimpleCaptcha/Captcha.php
@@ -1150,7 +1150,8 @@
 
                        // If we failed a captcha, override the generic 
'Warning' result string
                        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' ) {
                                                $this->addCaptchaAPI( $result );
                                                $result['result'] = 
'NeedCaptcha';
@@ -1161,6 +1162,8 @@
                                                        'event' => 
'captcha.display',
                                                        'type' => 
'accountcreation',
                                                ) );
+
+                                               break;
                                        }
                                }
                        }

-- 
To view, visit https://gerrit.wikimedia.org/r/285458
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5975c34be4fc11af8dcdd394c0c6605e72f13582
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ConfirmEdit
Gerrit-Branch: master
Gerrit-Owner: GergÅ‘ Tisza <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to