public function accepts($type)
    {
        foreach ($this->accept as $accept_type => $priority)
        {
            if (strpos($accept_type, "*") !== false)
            {
                $regexp = "/" . str_replace("WC", ".*", preg_quote(str_replace("*", "WC", $accept_type), "/")) . "/i";
                if (preg_match($regexp, $type))
                    return $priority;
            }
            elseif (strtolower($type) === strtolower($accept_type))
                return $priority;
        }

        return 0;
    }