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:
Leonid Nikitin 2023-11-26 15:25:36 +06:00
parent 520a3ba068
commit 10425db5e0
Signed by: kor-elf
GPG Key ID: 604A019EB118CAC4

View File

@ -19,7 +19,7 @@ final class StringType extends Type
$success = $this->randomSymbols($lengthSymbols); $success = $this->randomSymbols($lengthSymbols);
$fakes = []; $fakes = [];
if (!empty($lengthFakeSymbols)) { if (!empty($lengthFakeSymbols)) {
$fakes = $this->randomSymbols($lengthFakeSymbols, $fakes); $fakes = $this->randomSymbols($lengthFakeSymbols, $success);
} }
return new Symbols( return new Symbols(