diff options
author | Yaco <franco@reevo.org> | 2019-09-09 03:50:43 -0300 |
---|---|---|
committer | Yaco <franco@reevo.org> | 2019-09-09 03:50:43 -0300 |
commit | 9277314baf159377411739e010e8e46d12185328 (patch) | |
tree | bc865538d3c4ff404e4440465fd7396bcba04a38 /www/wiki | |
parent | 7723fb706bda6662d899e733b809fcf3dec45389 (diff) |
agrega suporte multilenguaje al captcha
Diffstat (limited to 'www/wiki')
-rw-r--r-- | www/wiki/extensions/ConfirmEdit/QuestyCaptcha/QuestyCaptcha.class.php | 9 |
1 files changed, 9 insertions, 0 deletions
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 ) ) { |