Support Joomla!

references:joomla.framework:environment:jrequest-cleanvar

Table of Contents

cleanVar

API Package Subpackage Class Method Reference Last reviewed Doc status
API Home Package Joomla.Framework Subpackage Environment Class JRequest Method cleanVar Reference cleanVar() Never Work in Progress

Utility method to clean a string variable using input filters. This function operates on strings. If an array is passed, the function recursively calls itself to traverse each element of the array. It will return raw variables which are not strings.

Syntax

mixed cleanVar ( &$var, $mask )

$var mixed is the variable to clean
$mask int is an options mask. This parameter is optional and if omitted defaults to 0 (no masks).

The available masks are:

  • JREQUEST_NOTRIM : Prevents the trimming of the variable
  • JREQUEST_ALLOWHTML : Allows safe HTML in the variable
  • JREQUEST_ALLOWRAW : Allows raw input

Examples

Example

$dirty = '<B>Testing cleaning<INPUT type="hidden" name="password" value="password" />';

echo JRequest::cleanVar ( $dirty );
 
references/joomla.framework/environment/jrequest-cleanvar.txt (1095 views) · Last modified: 2007/08/15 14:51