Answers to captcha questions are no longer case-sensitive
authorMarcel Werk <burntime@woltlab.com>
Mon, 26 Feb 2024 12:22:49 +0000 (13:22 +0100)
committerOlaf Braun <info@braun-development.de>
Thu, 7 Mar 2024 15:37:05 +0000 (16:37 +0100)
wcfsetup/install/files/lib/data/captcha/question/CaptchaQuestion.class.php

index f71ea1685fbcc8ac2a2960525d8298433c9ea786..0c3fe3b810909dc42d9df21cf9866d5e1b28e958 100644 (file)
@@ -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;
             }
         }