From c81d3283a6e9ea31b24ff94c952d2638bc8651a8 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Mon, 26 Feb 2024 13:22:49 +0100 Subject: [PATCH] Answers to captcha questions are no longer case-sensitive --- .../files/lib/data/captcha/question/CaptchaQuestion.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/data/captcha/question/CaptchaQuestion.class.php b/wcfsetup/install/files/lib/data/captcha/question/CaptchaQuestion.class.php index f71ea1685f..0c3fe3b810 100644 --- a/wcfsetup/install/files/lib/data/captcha/question/CaptchaQuestion.class.php +++ b/wcfsetup/install/files/lib/data/captcha/question/CaptchaQuestion.class.php @@ -43,12 +43,12 @@ class CaptchaQuestion extends DatabaseObject $answers = \explode("\n", StringUtil::unifyNewlines(WCF::getLanguage()->get($this->answers))); foreach ($answers as $__answer) { if (\mb_substr($__answer, 0, 1) == '~' && \mb_substr($__answer, -1, 1) == '~') { - if (Regex::compile(\mb_substr($__answer, 1, \mb_strlen($__answer) - 2))->match($answer)) { + if (Regex::compile(\mb_substr($__answer, 1, \mb_strlen($__answer) - 2), Regex::CASE_INSENSITIVE)->match($answer)) { return true; } continue; - } elseif ($__answer == $answer) { + } elseif (\mb_strtolower($__answer) == \mb_strtolower($answer)) { return true; } } -- 2.20.1