From 9277314baf159377411739e010e8e46d12185328 Mon Sep 17 00:00:00 2001 From: Yaco Date: Mon, 9 Sep 2019 03:50:43 -0300 Subject: agrega suporte multilenguaje al captcha --- .../extensions/ConfirmEdit/QuestyCaptcha/QuestyCaptcha.class.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/www/wiki/extensions/ConfirmEdit/QuestyCaptcha/QuestyCaptcha.class.php b/www/wiki/extensions/ConfirmEdit/QuestyCaptcha/QuestyCaptcha.class.php index 95da1021..a42992e4 100644 --- a/www/wiki/extensions/ConfirmEdit/QuestyCaptcha/QuestyCaptcha.class.php +++ b/www/wiki/extensions/ConfirmEdit/QuestyCaptcha/QuestyCaptcha.class.php @@ -55,6 +55,15 @@ class QuestyCaptcha extends SimpleCaptcha { */ function getCaptcha() { global $wgCaptchaQuestions; + global $wgLang; + $currentlang = $wgLang->getCode(); + + if (array_key_exists($currentlang,$wgCaptchaQuestions)) { + $wgCaptchaQuestions = $wgCaptchaQuestions[$currentlang]; + } else { + $default = array_key_first($wgCaptchaQuestions); + $wgCaptchaQuestions = $wgCaptchaQuestions[$default]; + } // Backwards compatibility if ( $wgCaptchaQuestions === array_values( $wgCaptchaQuestions ) ) { -- cgit v1.2.1