jenkins-bot has submitted this change and it was merged.

Change subject: Make Questy answers in arrays case-insensitive
......................................................................


Make Questy answers in arrays case-insensitive

Before, QuestyCaptcha answers were case-insensitive when there was
only one answer for a question, but they had to be lowercase when
there was an array of answers. This makes it so that when an array
of answers is provided for a question in $wgCaptchaQuestions, those
answers are case-insensitive.

Bug: T65272
Change-Id: I146b53cacf901c45ce27bd87fdf8125bfd2bc270
---
M QuestyCaptcha/QuestyCaptcha.class.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  TTO: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/QuestyCaptcha/QuestyCaptcha.class.php 
b/QuestyCaptcha/QuestyCaptcha.class.php
index 2e5274a..7f0f356 100644
--- a/QuestyCaptcha/QuestyCaptcha.class.php
+++ b/QuestyCaptcha/QuestyCaptcha.class.php
@@ -13,7 +13,7 @@
        /** Validate a captcha response */
        function keyMatch( $answer, $info ) {
                if ( is_array( $info['answer'] ) ) {
-                       return in_array( strtolower( $answer ), $info['answer'] 
);
+                       return in_array( strtolower( $answer ), array_map( 
'strtolower', $info['answer'] ) );
                } else {
                        return strtolower( $answer ) == strtolower( 
$info['answer'] );
                }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I146b53cacf901c45ce27bd87fdf8125bfd2bc270
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/ConfirmEdit
Gerrit-Branch: master
Gerrit-Owner: leucosticte <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: Emufarmers <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Jalexander <[email protected]>
Gerrit-Reviewer: TTO <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to