Merge branch 'chrome-form-replay' into 'v2.0'

fix Chrome warns about compromised data when using form replay (#2694)

See merge request lemonldap-ng/lemonldap-ng!251
This commit is contained in:
Yadd 2022-02-13 12:51:04 +00:00
commit 96fbf6cd90
1 changed files with 2 additions and 1 deletions

View File

@ -898,7 +898,8 @@ sub postJavascript {
my $filler;
foreach my $name ( keys %$data ) {
use bytes;
my $value = "x" x bytes::length( $data->{$name} );
my @characterSet = ( '0' ..'9', 'A' .. 'Z', 'a' .. 'z' );
my $value = join '' => map $characterSet[ rand @characterSet ], 1 .. bytes::length( $data->{$name} );
$filler .=
"form.find('input[name=\"$name\"], select[name=\"$name\"], textarea[name=\"$name\"]').val('$value')\n";
}