protected function isHTML()
    {
        if (function_exists('headers_list') && $headers = headers_list())
        {
            foreach ((array) $headers as $header)
            {
                $header = strtolower($header);

                if (strpos($header, 'content-type:') === 0 && !strpos($header, 'text/html'))
                {
                    return false;
                }
            }
        }

        return true;
    }