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.
This commit is contained in:
2023-11-26 15:25:36 +06:00
parent 520a3ba068
commit 10425db5e0

View File

@@ -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(