Input::sanitize (method)

Last updated: Tue, Oct 31, 2023 11:49 am
Return to Knowledgebase

Purpose

Sanitizes non form data for storage in the database

Location

users/classes/Input.php

See Also:

Input::get (method)

Parameters

# Parameter Data Type Required Description
1 $item Yes undocumented

Example

Input::sanitize('aRandomStringOfData')

Further Documentation:

Sanitizing your form input is critical to security. Do not simply pass $_GET or $_POST data into your database. This method properly escapes the strings and is generally used when your data comes from some user input other than a form.
$data = Input::sanitize('aRandomStringOfData'); 

Please note that your data may require other types of security checks before storing into the database, but this method handles the basics.