diff options
Diffstat (limited to 'user_guide')
-rw-r--r-- | user_guide/changelog.html | 8 | ||||
-rw-r--r-- | user_guide/libraries/form_validation.html | 310 |
2 files changed, 177 insertions, 141 deletions
diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 09a2cefce..cd728226b 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -63,6 +63,14 @@ Change Log <p>Release Date: n/a<br /> Hg Tag: n/a</p> +<ul> + <li>Libraries + <ul> + <li class="reactor">Added <kbd>decimal</kbd>, <kbd>less_than</kbd> and <kbd>greater_than</kbd> rules to the <a href="libraries/parser.html">Form validation Class</a>.</li> + </ul> + </li> +</ul> + <h3>Bug fixes for 2.0.1</h3> <ul> <li class="reactor">CLI requests can now be run from any folder, not just when CD'ed next to index.php.</li> diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index 935dca61f..d6120054b 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -924,118 +924,146 @@ POST array:</p> <p>The following is a list of all the native rules that are available to use:</p> - <table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder"> -<tr> -<th>Rule</th> -<th>Parameter</th> -<th>Description</th> -<th>Example</th> -</tr><tr> - -<td class="td"><strong>required</strong></td> -<td class="td">No</td> -<td class="td">Returns FALSE if the form element is empty.</td> -<td class="td"> </td> -</tr><tr> - -<td class="td"><strong>matches</strong></td> -<td class="td">Yes</td> -<td class="td">Returns FALSE if the form element does not match the one in the parameter.</td> -<td class="td">matches[form_item]</td> -</tr><tr> - -<td class="td"><strong>min_length</strong></td> -<td class="td">Yes</td> -<td class="td">Returns FALSE if the form element is shorter then the parameter value.</td> -<td class="td">min_length[6]</td> -</tr><tr> - -<td class="td"><strong>max_length</strong></td> -<td class="td">Yes</td> -<td class="td">Returns FALSE if the form element is longer then the parameter value.</td> -<td class="td">max_length[12]</td> -</tr><tr> - -<td class="td"><strong>exact_length</strong></td> -<td class="td">Yes</td> -<td class="td">Returns FALSE if the form element is not exactly the parameter value.</td> -<td class="td">exact_length[8]</td> -</tr><tr> - -<td class="td"><strong>alpha</strong></td> -<td class="td">No</td> -<td class="td">Returns FALSE if the form element contains anything other than alphabetical characters.</td> -<td class="td"> </td> -</tr><tr> - -<td class="td"><strong>alpha_numeric</strong></td> -<td class="td">No</td> -<td class="td">Returns FALSE if the form element contains anything other than alpha-numeric characters.</td> -<td class="td"> </td> -</tr><tr> - -<td class="td"><strong>alpha_dash</strong></td> -<td class="td">No</td> -<td class="td">Returns FALSE if the form element contains anything other than alpha-numeric characters, underscores or dashes.</td> -<td class="td"> </td> -</tr> - -<tr> -<td class="td"><strong>numeric</strong></td> -<td class="td">No</td> -<td class="td">Returns FALSE if the form element contains anything other than numeric characters.</td> -<td class="td"> </td> -</tr> - -<tr> -<td class="td"><strong>integer</strong></td> -<td class="td">No</td> -<td class="td">Returns FALSE if the form element contains anything other than an integer.</td> -<td class="td"> </td> -</tr> - -<tr> -<td class="td"><strong>is_natural</strong></td> -<td class="td">No</td> -<td class="td">Returns FALSE if the form element contains anything other than a natural number: 0, 1, 2, 3, etc.</td> -<td class="td"> </td> -</tr> - -<tr> -<td class="td"><strong>is_natural_no_zero</strong></td> -<td class="td">No</td> -<td class="td">Returns FALSE if the form element contains anything other than a natural number, but not zero: 1, 2, 3, etc.</td> -<td class="td"> </td> -</tr> - -<tr> -<td class="td"><strong>valid_email</strong></td> -<td class="td">No</td> -<td class="td">Returns FALSE if the form element does not contain a valid email address.</td> -<td class="td"> </td> -</tr> - -<tr> -<td class="td"><strong>valid_emails</strong></td> -<td class="td">No</td> -<td class="td">Returns FALSE if any value provided in a comma separated list is not a valid email.</td> -<td class="td"> </td> -</tr> - -<tr> -<td class="td"><strong>valid_ip</strong></td> -<td class="td">No</td> -<td class="td">Returns FALSE if the supplied IP is not valid.</td> -<td class="td"> </td> -</tr> - -<tr> -<td class="td"><strong>valid_base64</strong></td> -<td class="td">No</td> -<td class="td">Returns FALSE if the supplied string contains anything other than valid Base64 characters.</td> -<td class="td"> </td> -</tr> + <tr> + <th>Rule</th> + <th>Parameter</th> + <th>Description</th> + <th>Example</th> + </tr> + + <tr> + <td class="td"><strong>required</strong></td> + <td class="td">No</td> + <td class="td">Returns FALSE if the form element is empty.</td> + <td class="td"> </td> + </tr> + + <tr> + <td class="td"><strong>matches</strong></td> + <td class="td">Yes</td> + <td class="td">Returns FALSE if the form element does not match the one in the parameter.</td> + <td class="td">matches[form_item]</td> + </tr> + + <tr> + <td class="td"><strong>min_length</strong></td> + <td class="td">Yes</td> + <td class="td">Returns FALSE if the form element is shorter then the parameter value.</td> + <td class="td">min_length[6]</td> + </tr> + + <tr> + <td class="td"><strong>max_length</strong></td> + <td class="td">Yes</td> + <td class="td">Returns FALSE if the form element is longer then the parameter value.</td> + <td class="td">max_length[12]</td> + </tr> + + <tr> + <td class="td"><strong>exact_length</strong></td> + <td class="td">Yes</td> + <td class="td">Returns FALSE if the form element is not exactly the parameter value.</td> + <td class="td">exact_length[8]</td> + </tr> + + <tr> + <td class="td"><strong>greater_than</strong></td> + <td class="td">Yes</td> + <td class="td">Returns FALSE if the form element is less than the parameter value or not numeric.</td> + <td class="td">greater_than[8]</td> + </tr> + + <tr> + <td class="td"><strong>less_than</strong></td> + <td class="td">Yes</td> + <td class="td">Returns FALSE if the form element is greater than the parameter value or not numeric.</td> + <td class="td">less_than[8]</td> + </tr> + + <tr> + <td class="td"><strong>alpha</strong></td> + <td class="td">No</td> + <td class="td">Returns FALSE if the form element contains anything other than alphabetical characters.</td> + <td class="td"> </td> + </tr> + + <tr> + <td class="td"><strong>alpha_numeric</strong></td> + <td class="td">No</td> + <td class="td">Returns FALSE if the form element contains anything other than alpha-numeric characters.</td> + <td class="td"> </td> + </tr> + + <tr> + <td class="td"><strong>alpha_dash</strong></td> + <td class="td">No</td> + <td class="td">Returns FALSE if the form element contains anything other than alpha-numeric characters, underscores or dashes.</td> + <td class="td"> </td> + </tr> + + <tr> + <td class="td"><strong>numeric</strong></td> + <td class="td">No</td> + <td class="td">Returns FALSE if the form element contains anything other than numeric characters.</td> + <td class="td"> </td> + </tr> + + <tr> + <td class="td"><strong>integer</strong></td> + <td class="td">No</td> + <td class="td">Returns FALSE if the form element contains anything other than an integer.</td> + <td class="td"> </td> + </tr> + + <tr> + <td class="td"><strong>decimal</strong></td> + <td class="td">Yes</td> + <td class="td">Returns FALSE if the form element is not exactly the parameter value.</td> + <td class="td"> </td> + </tr> + + <tr> + <td class="td"><strong>is_natural</strong></td> + <td class="td">No</td> + <td class="td">Returns FALSE if the form element contains anything other than a natural number: 0, 1, 2, 3, etc.</td> + <td class="td"> </td> + </tr> + + <tr> + <td class="td"><strong>is_natural_no_zero</strong></td> + <td class="td">No</td> + <td class="td">Returns FALSE if the form element contains anything other than a natural number, but not zero: 1, 2, 3, etc.</td> + <td class="td"> </td> + </tr> + + <tr> + <td class="td"><strong>valid_email</strong></td> + <td class="td">No</td> + <td class="td">Returns FALSE if the form element does not contain a valid email address.</td> + <td class="td"> </td> + </tr> + + <tr> + <td class="td"><strong>valid_emails</strong></td> + <td class="td">No</td> + <td class="td">Returns FALSE if any value provided in a comma separated list is not a valid email.</td> + <td class="td"> </td> + </tr> + + <tr> + <td class="td"><strong>valid_ip</strong></td> + <td class="td">No</td> + <td class="td">Returns FALSE if the supplied IP is not valid.</td> + <td class="td"> </td> + </tr> + + <tr> + <td class="td"><strong>valid_base64</strong></td> + <td class="td">No</td> + <td class="td">Returns FALSE if the supplied string contains anything other than valid Base64 characters.</td> + <td class="td"> </td> + </tr> </table> @@ -1058,36 +1086,36 @@ POST array:</p> <table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder"> -<tr> -<th>Name</th> -<th>Parameter</th> -<th>Description</th> -</tr><tr> - -<td class="td"><strong>xss_clean</strong></td> -<td class="td">No</td> -<td class="td">Runs the data through the XSS filtering function, described in the <a href="input.html">Input Class</a> page.</td> -</tr><tr> - -<td class="td"><strong>prep_for_form</strong></td> -<td class="td">No</td> -<td class="td">Converts special characters so that HTML data can be shown in a form field without breaking it.</td> -</tr><tr> - -<td class="td"><strong>prep_url</strong></td> -<td class="td">No</td> -<td class="td">Adds "http://" to URLs if missing.</td> -</tr><tr> - -<td class="td"><strong>strip_image_tags</strong></td> -<td class="td">No</td> -<td class="td">Strips the HTML from image tags leaving the raw URL.</td> -</tr><tr> - -<td class="td"><strong>encode_php_tags</strong></td> -<td class="td">No</td> -<td class="td">Converts PHP tags to entities.</td> -</tr> + <tr> + <th>Name</th> + <th>Parameter</th> + <th>Description</th> + </tr><tr> + + <td class="td"><strong>xss_clean</strong></td> + <td class="td">No</td> + <td class="td">Runs the data through the XSS filtering function, described in the <a href="input.html">Input Class</a> page.</td> + </tr><tr> + + <td class="td"><strong>prep_for_form</strong></td> + <td class="td">No</td> + <td class="td">Converts special characters so that HTML data can be shown in a form field without breaking it.</td> + </tr><tr> + + <td class="td"><strong>prep_url</strong></td> + <td class="td">No</td> + <td class="td">Adds "http://" to URLs if missing.</td> + </tr><tr> + + <td class="td"><strong>strip_image_tags</strong></td> + <td class="td">No</td> + <td class="td">Strips the HTML from image tags leaving the raw URL.</td> + </tr><tr> + + <td class="td"><strong>encode_php_tags</strong></td> + <td class="td">No</td> + <td class="td">Converts PHP tags to entities.</td> + </tr> </table> |