Page 1 of 1

Generating codes

Posted: Thu Sep 17, 2020 11:27 am
by jamesd
Quick question, when creating codes using the code module we have the choice of including numbers as well as lowercase and uppercase letters.

I'm seeing some strange behaviour:

[x] 0-9
[ ] a-z
[ ] A-Z
= Creates numeric codes correctly.

[ ] 0-9
[×] a-z
[ ] A-Z
= Creates lower case codes correctly.

[ ] 0-9
[ ] a-z
[×] A-Z
= Wrongly creates lower case codes.

[×] 0-9
[×] a-z
[ ] A-Z
= Wrongly creates codes with a mixture of numeric and upper case.

[×] 0-9
[ ] a-z
[×] A-Z
= Wrongly creates codes with a mixture of numeric and lower case.

[ ] 0-9
[×] a-z
[×] A-Z
= Creates lower and upper case codes correctly.

[×] 0-9
[×] a-z
[×] A-Z
= Creates codes with a mixture of numeric and both upper and lower case.

Looks like it might be a relatively straightforward bug with a mixup somewhere in the logic, does anyone have a fix?

Re: Generating codes

Posted: Thu Sep 17, 2020 11:40 am
by alfa24
In /appCore/modules/code/code.php

find:

Code: Select all

elseif ($use_number && $use_low_letter) {
replace with:

Code: Select all

elseif ($use_number && $use_high_letter) {
find:

Code: Select all

elseif ($use_number && $use_high_letter) {
replace with:

Code: Select all

elseif ($use_number && $use_low_letter) {
find:

Code: Select all

if ($use_low_letter)
replace with:

Code: Select all

if ($use_high_letter)
find:

Code: Select all

if ($use_high_letter)
replace with:

Code: Select all

if ($use_low_letter)

Re: Generating codes

Posted: Fri Sep 18, 2020 9:18 am
by jamesd
Thank you again. :)