protected static function _cleanVar($var, $mask = 0, $type = null)
	{
		// If the no trim flag is not set, trim the variable
		if (!($mask & 1) && is_string($var))
		{
			$var = trim($var);
		}

		// Now we handle input filtering
		if ($mask & 2)
		{
			// If the allow raw flag is set, do not modify the variable
			$var = $var;
		}
		elseif ($mask & 4)
		{
			// If the allow HTML flag is set, apply a safe HTML filter to the variable
			$safeHtmlFilter = JFilterInput::getInstance(null, null, 1, 1);
			$var = $safeHtmlFilter->clean($var, $type);
		}
		else
		{
			// Since no allow flags were set, we will apply the most strict filter to the variable
			// $tags, $attr, $tag_method, $attr_method, $xss_auto use defaults.
			$noHtmlFilter = JFilterInput::getInstance();
			$var = $noHtmlFilter->clean($var, $type);
		}

		return $var;
	}
protected static function _cleanVar($var, $mask = 0, $type = null)
	{
		// If the no trim flag is not set, trim the variable
		if (!($mask & 1) && is_string($var))
		{
			$var = trim($var);
		}

		// Now we handle input filtering
		if ($mask & 2)
		{
			// If the allow raw flag is set, do not modify the variable
			$var = $var;
		}
		elseif ($mask & 4)
		{
			// If the allow HTML flag is set, apply a safe HTML filter to the variable
			$safeHtmlFilter = JFilterInput::getInstance(null, null, 1, 1);
			$var = $safeHtmlFilter->clean($var, $type);
		}
		else
		{
			// Since no allow flags were set, we will apply the most strict filter to the variable
			// $tags, $attr, $tag_method, $attr_method, $xss_auto use defaults.
			$noHtmlFilter = JFilterInput::getInstance();
			$var = $noHtmlFilter->clean($var, $type);
		}

		return $var;
	}
protected static function _cleanVar ( $ var , $ mask = 0 , $ type = null ) { // If the no trim flag is not set, trim the variable if ( ! ( $ mask & 1 ) && is_string ( $ var ) ) { $ var = trim ( $ var ) ; } // Now we handle input filtering if ( $ mask & 2 ) { // If the allow raw flag is set, do not modify the variable $ var = $ var ; } elseif ( $ mask & 4 ) { // If the allow HTML flag is set, apply a safe HTML filter to the variable $ safeHtmlFilter = JFilterInput :: getInstance ( null , null , 1 , 1 ) ; $ var = $ safeHtmlFilter -> clean ( $ var , $ type ) ; } else { // Since no allow flags were set, we will apply the most strict filter to the variable // $tags, $attr, $tag_method, $attr_method, $xss_auto use defaults. $ noHtmlFilter = JFilterInput :: getInstance ( ) ; $ var = $ noHtmlFilter -> clean ( $ var , $ type ) ; } return $ var ; }
Clean up an input variable.

@param   mixed    $var   The input variable.
@param   integer  $mask  Filter bit mask.
1 = no trim: If this flag is cleared and the input is a string, the string will have leading and trailing
whitespace trimmed.
2 = allow_raw: If set, no more filtering is performed, higher bits are ignored.
4 = allow_html: HTML is allowed, but passed through a safe HTML filter first. If set, no more filtering
is performed. If no bits other than the 1 bit is set, a strict filter is applied.
@param   string   $type  The variable type {@see JFilterInput::clean()}.

@return  mixed  Same as $var

@deprecated  12.1
@since       11.1
Clean up an input variable .