Skip to content
This repository has been archived by the owner on Oct 14, 2021. It is now read-only.

Trim the Verification Code field before validating #5

Open
NickJH opened this issue Oct 7, 2019 · 0 comments
Open

Trim the Verification Code field before validating #5

NickJH opened this issue Oct 7, 2019 · 0 comments

Comments

@NickJH
Copy link

NickJH commented Oct 7, 2019

If you copy your validation code from you e-mail by double-clicking on the verification code to select the code, when you paste it into the Verification Code field it pastes with a leading blank and this fails verification. I think it would be a good idea to trim the field before validating it. This can be achieved by changing line 915 of /usr/clearos/apps/two_factor_auth/libraries/Two_Factor_Auth.php from if (! preg_match("/^([a-zA-Z0-9]+)$/", $code)) to if (! preg_match("/^([a-zA-Z0-9]+)$/", trim($code)))

Tested with the Thunderbird e-mail client.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant