From 0bb5cd4b1bc794f67f0089ae309ffa9b8000e831 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 18 May 2015 11:02:43 +0300 Subject: [ci skip] Remove example usage of MD5 for passwords --- user_guide_src/source/libraries/form_validation.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst index dbf1e8a63..fa50c6dcf 100644 --- a/user_guide_src/source/libraries/form_validation.rst +++ b/user_guide_src/source/libraries/form_validation.rst @@ -327,15 +327,15 @@ can also prep your data in various ways. For example, you can set up rules like this:: $this->form_validation->set_rules('username', 'Username', 'trim|required|min_length[5]|max_length[12]'); - $this->form_validation->set_rules('password', 'Password', 'trim|required|md5'); + $this->form_validation->set_rules('password', 'Password', 'trim|required|min_length[8]'); $this->form_validation->set_rules('passconf', 'Password Confirmation', 'trim|required|matches[password]'); $this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email'); In the above example, we are "trimming" the fields, checking for length -where necessary and converting the password to MD5. +where necessary and making sure that both password fields match. **Any native PHP function that accepts one parameter can be used as a -rule, like htmlspecialchars, trim, md5, etc.** +rule, like ``htmlspecialchars()``, ``trim()``, etc.** .. note:: You will generally want to use the prepping functions **after** the validation rules so if there is an error, the -- cgit v1.2.3-24-g4f1b