public function filter($data = null, $filter = false)
    {
        if (is_null($data)) {
            return null;
        }

        if (is_array($data)) {
            return array_map(function ($value) use ($filter) {
                return $this->filter($value, $filter);
            }, $data);
        }

        return ($filter == true ? $this->xssClean($data) : trim($data));
    }
public function filter($data = null, $filter = false)
    {
        if (is_null($data)) {
            return null;
        }

        if (is_array($data)) {
            return array_map(function ($value) use ($filter) {
                return $this->filter($value, $filter);
            }, $data);
        }

        return ($filter == true ? $this->xssClean($data) : trim($data));
    }
public function filter ( $ data = null , $ filter = false ) { if ( is_null ( $ data ) ) { return null ; } if ( is_array ( $ data ) ) { return array_map ( function ( $ value ) use ( $ filter ) { return $ this -> filter ( $ value , $ filter ) ; } , $ data ) ; } return ( $ filter == true ? $ this -> xssClean ( $ data ) : trim ( $ data ) ) ; }
Filter method for HTTP Values.

@param string $data
@param bool   $filter

@return string|null
Filter method for HTTP Values .