Sanitize Class Reference
Public Member Functions | |
| stripAll ($str) | |
Static Public Member Functions | |
| clean ($data, $options=array()) | |
| escape ($string, $connection= 'default') | |
| formatColumns (&$model) | |
| html ($string, $remove=false) | |
| paranoid ($string, $allowed=array()) | |
| stripImages ($str) | |
| stripScripts ($str) | |
| stripTags () | |
| stripWhitespace ($str) | |
Detailed Description
Definition at line 38 of file sanitize.php.
Member Function Documentation
| Sanitize::clean | ( | $ | data, | |
| $ | options = array() | |||
| ) | [static] |
Sanitizes given array or value for safe input. Use the options to specify the connection to use, and what filters should be applied (with a boolean value). Valid filters: odd_spaces, encode, dollar, carriage, unicode, escape, backslash.
- Parameters:
-
mixed $data Data to sanitize mixed $options If string, DB connection being used, otherwise set of options
- Returns:
- mixed Sanitized data public
Definition at line 179 of file sanitize.php.
| Sanitize::escape | ( | $ | string, | |
| $ | connection = 'default' | |||
| ) | [static] |
Makes a string SQL-safe.
- Parameters:
-
string $string String to sanitize string $connection Database connection being used
- Returns:
- string SQL safe string public
Definition at line 74 of file sanitize.php.
References ConnectionManager::getDataSource().
| Sanitize::formatColumns | ( | &$ | model | ) | [static] |
Formats column data from definition in DBO's $columns array
- Parameters:
-
Model $model The model containing the data to be formatted public
Definition at line 241 of file sanitize.php.
| Sanitize::html | ( | $ | string, | |
| $ | remove = false | |||
| ) | [static] |
Returns given string safe for display as HTML. Renders entities.
- Parameters:
-
string $string String from where to strip tags boolean $remove If true, the string is stripped of all HTML tags
- Returns:
- string Sanitized string public
Definition at line 92 of file sanitize.php.
| Sanitize::paranoid | ( | $ | string, | |
| $ | allowed = array() | |||
| ) | [static] |
Removes any non-alphanumeric characters.
- Parameters:
-
string $string String to sanitize
- Returns:
- string Sanitized string public
Definition at line 47 of file sanitize.php.
| Sanitize::stripAll | ( | $ | str | ) |
Strips extra whitespace, images, scripts and stylesheets from output
- Parameters:
-
string $str String to sanitize public
Definition at line 142 of file sanitize.php.
| Sanitize::stripImages | ( | $ | str | ) | [static] |
Strips image tags from output
- Parameters:
-
string $str String to sanitize public
Definition at line 120 of file sanitize.php.
| Sanitize::stripScripts | ( | $ | str | ) | [static] |
Strips scripts and stylesheets from output
- Parameters:
-
string $str String to sanitize public
Definition at line 133 of file sanitize.php.
| Sanitize::stripTags | ( | ) | [static] |
Strips the specified tags from output. First parameter is string from where to remove tags. All subsequent parameters are tags.
- Parameters:
-
string $str String to sanitize string $tag Tag to remove (add more parameters as needed) public
Definition at line 157 of file sanitize.php.
| Sanitize::stripWhitespace | ( | $ | str | ) | [static] |
Strips extra whitespace from output
- Parameters:
-
string $str String to sanitize public
Definition at line 109 of file sanitize.php.
The documentation for this class was generated from the following file:
- 1.2.x.x/cake/libs/sanitize.php