diff options
author | Miquel Lionel <lionelmiquel@sfr.fr> | 2021-02-24 22:24:08 +0100 |
---|---|---|
committer | Miquel Lionel <lionelmiquel@sfr.fr> | 2021-02-24 22:24:08 +0100 |
commit | c88f9dd97f8159a834fa3e253d64b4edb50aee18 (patch) | |
tree | 059f24e1d00265bcec00fea1bd287ad91f3d55e5 /gpigeon-template.cgi | |
parent | ca421fea5bf928349ad9d3d906f9cfc7d8e8124e (diff) | |
download | gpigeon-c88f9dd97f8159a834fa3e253d64b4edb50aee18.tar.gz gpigeon-c88f9dd97f8159a834fa3e253d64b4edb50aee18.zip |
cleaning up the generating filename part
Diffstat (limited to 'gpigeon-template.cgi')
-rwxr-xr-x | gpigeon-template.cgi | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/gpigeon-template.cgi b/gpigeon-template.cgi index b0ad66a..756e56c 100755 --- a/gpigeon-template.cgi +++ b/gpigeon-template.cgi @@ -119,16 +119,10 @@ if (argon2id_verify($PASSWD_HASH,$PASSWD)){ if ( Email::Valid->address($non_gpguser) ){ $notif_mail_valide = qq{<span style="color:green">$text_strings{addr} $non_gpguser $text_strings{addr_ok}</span>}; my $escaped_non_gpguser = escape_arobase($non_gpguser); - my $random_mailform_fn_str = String::Random->new; - my @mailform_fn_str_buffer = (); - - for (1..5){ - push @mailform_fn_str_buffer, - $random_mailform_fn_str->randregex('\w{64}'); - } - - my $mailform_fn_str_buffer_nospace = join('',@mailform_fn_str_buffer); - my $GENERATED_FORM_FILENAME = "$mailform_fn_str_buffer_nospace.cgi"; + my $str_rand_obj = String::Random->new; + my $random_fn = $str_rand_obj->randregex('\w{64}'); + + my $GENERATED_FORM_FILENAME = "$random_fn.cgi"; my $MAILFORM_LINK = "http://$SRV_NAME/cgi-bin/l/$GENERATED_FORM_FILENAME"; my $MAILFORM_RELPATH = "./l/$GENERATED_FORM_FILENAME"; if (open my $gpg_form_fh, ">", $MAILFORM_RELPATH){ |