code/http/message/parameters.php
public function get($identifier, $filter, $default = null)
    {
        $keys = $this->_parseIdentifier($identifier);

        $result = $this->toArray();
        foreach($keys as $key)
        {
            if(array_key_exists($key, $result)) {
                $result = $result[$key];
            } else {
                $result = null;
                break;
            }
        }

        // If the value is null return the default
        if(!is_null($result))
        {
            // Handle magic quotes compatibility
            if (get_magic_quotes_gpc()) {
                $result = $this->_stripSlashes( $result );
            }

            // Filter the data
            if(!($filter instanceof FilterInterface)) {
                $filter = $this->getObject('filter.factory')->createChain($filter);
            }

            $result = $filter->sanitize($result);
        }
        else $result = $default;

        return $result;
    }
public function get($identifier, $filter, $default = null)
    {
        $keys = $this->_parseIdentifier($identifier);

        $result = $this->toArray();
        foreach($keys as $key)
        {
            if(array_key_exists($key, $result)) {
                $result = $result[$key];
            } else {
                $result = null;
                break;
            }
        }

        // If the value is null return the default
        if(!is_null($result))
        {
            // Handle magic quotes compatibility
            if (get_magic_quotes_gpc()) {
                $result = $this->_stripSlashes( $result );
            }

            // Filter the data
            if(!($filter instanceof FilterInterface)) {
                $filter = $this->getObject('filter.factory')->createChain($filter);
            }

            $result = $filter->sanitize($result);
        }
        else $result = $default;

        return $result;
    }
public function get ( $ identifier , $ filter , $ default = null ) { $ keys = $ this -> _parseIdentifier ( $ identifier ) ; $ result = $ this -> toArray ( ) ; foreach ( $ keys as $ key ) { if ( array_key_exists ( $ key , $ result ) ) { $ result = $ result [ $ key ] ; } else { $ result = null ; break ; } } // If the value is null return the default if ( ! is_null ( $ result ) ) { // Handle magic quotes compatibility if ( get_magic_quotes_gpc ( ) ) { $ result = $ this -> _stripSlashes ( $ result ) ; } // Filter the data if ( ! ( $ filter instanceof FilterInterface ) ) { $ filter = $ this -> getObject ( 'filter.factory' ) -> createChain ( $ filter ) ; } $ result = $ filter -> sanitize ( $ result ) ; } else $ result = $ default ; return $ result ; }
Get a filtered parameter

@param   string  $identifier Parameter identifier, eg .foo.bar
@param   mixed   $filter     Filter(s), can be a Filter object, a filter name, an array of filter names or a filter
identifier
@param   mixed   $default    Default value when the variable doesn't exist
@return  mixed   The sanitized parameter
Get a filtered parameter