php - How to sanitize user password information in WordPress? -


I am capturing user name, email and password in my custom registration form on my WordPress site. Clears the email address to sanitize_user () and sanitize_email () .

For example:

  $ username = sanitize_user ($ username); $ Email = sanitize_email ($ email);  

How should I approve the password entered by the user? Think of sanitize_text_field ($ pass) , but I'm sure it's not the right way to do this.

Ref:

It is not necessary that you need to use a prepared statement to protect against injection by preserving it - or in case of WordPress, use it.

Synthesis strips only invalid characters; In the above cases, it removes characters that are not in user names or are not allowed in a valid email address. Passwords allow for many different types of characters because it is what makes them "strong", so that you do not want to snatch them.

If you are using to create a WP user, then you do not need to be able to customize it in any way, this task will take care of everyone for you.


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -