From 10425db5e016c7062fad6d6ea77468c61f1e94a6 Mon Sep 17 00:00:00 2001 From: Leonid Nikitin Date: Sun, 26 Nov 2023 15:25:36 +0600 Subject: [PATCH] Fixed a bug where two identical symbols appeared in a captcha. The commit fixes an issue where wrong variable was passed as second argument to randomSymbols method. Previously it was using an uninitialized variable 'fakes' which was supposed to be populated by 'success' variable. The 'success' variable already has the set of valid symbols which should be used to generate fake symbols for captcha. --- app/Captcha/Types/StringType.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Captcha/Types/StringType.php b/app/Captcha/Types/StringType.php index 121993a..a69c1cd 100644 --- a/app/Captcha/Types/StringType.php +++ b/app/Captcha/Types/StringType.php @@ -19,7 +19,7 @@ final class StringType extends Type $success = $this->randomSymbols($lengthSymbols); $fakes = []; if (!empty($lengthFakeSymbols)) { - $fakes = $this->randomSymbols($lengthFakeSymbols, $fakes); + $fakes = $this->randomSymbols($lengthFakeSymbols, $success); } return new Symbols(