public static function get($identifier, $filter, $default = null)
    {
        list($hash, $keys) = self::_parseIdentifier($identifier);

        $result = null;
        if (isset($GLOBALS['_'.$hash])) {
            $result = $GLOBALS['_'.$hash];
            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)) {
            return $default;
        }

        // Handle magic quotes compatability
        if (get_magic_quotes_gpc() && !in_array($hash, array('FILES', 'SESSION'))) {
            $result = self::_stripSlashes($result);
        }

        if (! ($filter instanceof AnFilterInterface)) {
            $filter = AnService::get('anahita:filter.factory')->instantiate($filter);
        }

        return $filter->sanitize($result);
    }
public static function get($identifier, $filter, $default = null)
    {
        list($hash, $keys) = self::_parseIdentifier($identifier);

        $result = null;
        if (isset($GLOBALS['_'.$hash])) {
            $result = $GLOBALS['_'.$hash];
            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)) {
            return $default;
        }

        // Handle magic quotes compatability
        if (get_magic_quotes_gpc() && !in_array($hash, array('FILES', 'SESSION'))) {
            $result = self::_stripSlashes($result);
        }

        if (! ($filter instanceof AnFilterInterface)) {
            $filter = AnService::get('anahita:filter.factory')->instantiate($filter);
        }

        return $filter->sanitize($result);
    }
public static function get ( $ identifier , $ filter , $ default = null ) { list ( $ hash , $ keys ) = self :: _parseIdentifier ( $ identifier ) ; $ result = null ; if ( isset ( $ GLOBALS [ '_' . $ hash ] ) ) { $ result = $ GLOBALS [ '_' . $ hash ] ; 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 ) ) { return $ default ; } // Handle magic quotes compatability if ( get_magic_quotes_gpc ( ) && ! in_array ( $ hash , array ( 'FILES' , 'SESSION' ) ) ) { $ result = self :: _stripSlashes ( $ result ) ; } if ( ! ( $ filter instanceof AnFilterInterface ) ) { $ filter = AnService :: get ( 'anahita:filter.factory' ) -> instantiate ( $ filter ) ; } return $ filter -> sanitize ( $ result ) ; }
Get sanitized data from the request.

@param   string              Variable identifier, prefixed by hash name eg post.foo.bar
@param   mixed               Filter(s), can be a KFilter object, a filter name, an array of filter names or a filter identifier
@param   mixed               Default value when the variable doesn't exist
@throws  AnRequestException   When an invalid filter was passed
@return  mixed               The sanitized data
Get sanitized data from the request .