JBAS-1925 eCard code generator skips vowels
authorBill Erickson <berickxx@gmail.com>
Tue, 24 Jul 2018 21:26:08 +0000 (17:26 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
To avoid creating any words which could be offensive.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Ecard.pm

index f6db282..ba8ae43 100644 (file)
@@ -55,7 +55,8 @@ my @api_fields = (
 
 # Random 6-character alpha-numeric code that avoids look-alike characters
 # https://ux.stackexchange.com/questions/53341/are-there-any-letters-numbers-that-should-be-avoided-in-an-id
-my @code_chars = ('A','C'..'F','H','J'..'N','P','R','T'..'Y','3','4','7','9');
+# Also exclude vowels to avoid creating any real (potentially offensive) words.
+my @code_chars = ('C','D','F','H','J'..'N','P','R','T','V','W','X','3','4','7','9');
 sub generate_verify_code {
     my $string = '';
     $string .= $code_chars[rand @code_chars] for 1..6;