Page 1 of 1

Password: changing preg_match in PHP Sign up

Posted: Tue Jun 06, 2017 6:31 am
by Aris
Hi.

I would wish your advice about two issues.

A. Changing the number of characters that inserted in the password

1.
I would like to change the number of characters that a user must insert in the sign up form.
The PHP code in the Sign up form is the following: ^[A-Za-z0-9_!@$]{1,50}$
I suppose, I can change the range {1,50} to, for example, {6,14}
Tell to me please: Is it correct?

2.
If your answer to question 1 is "YES",
I must change the range on the PHP code:
a. in the HTML object, or
b. In the Password > Editbox > Validate > Data length?


B. Changing the whole preg_match for the password

I see that the default preg_match for the password ^[A-Za-z0-9_!@$]{1,50}$ accepts only these special characters:_!@$

May I change the preg_match from this ^ A-Za-z0-9_!@$]{1,50}$ to this ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$@$!%*?&])[A-Za-z\d$@$!%*?&]{8,20} ?
Which means:
At least 1 uppercase letter
At least 1 lowercase letter
At least 1 number
At least 1 special character

May be the last preg_match is too difficult for the user or very wordy?

What is your advice?

Thank you.

Aris

Re: Password: changing preg_match in PHP Sign up

Posted: Tue Jun 06, 2017 6:36 am
by Pablo
1. Yes, you can change the range that way.
2. You will need to convert the signup object to a standard form then you can edit the code in the HTML object.

Note that there is no support on custom coding. All modifications are at your own risk.

Re: Password: changing preg_match in PHP Sign up

Posted: Tue Jun 06, 2017 6:46 am
by Aris
Thank you, Pablo.
I will follow your advice.
Note that there is no support on custom coding. All modifications are at your own risk.
May be dangerous for the security of my website and the users if I change the preg_match?

Re: Password: changing preg_match in PHP Sign up

Posted: Tue Jun 06, 2017 7:31 am
by Pablo
Yes, this may affect the security.

Re: Password: changing preg_match in PHP Sign up

Posted: Tue Jun 06, 2017 9:15 am
by Aris
Pablo, thank you.

Aris