Content-type sniffing

Based on the rules in http://tools.ietf.org/html/draft-abarth-mime-sniff-06

This is used since we can't always trust Content-Type headers, and is based upon the HTML5 parsing rules.

This class can be overloaded with \SimplePie::set_content_type_sniffer_class()

package SimplePie
subpackage HTTP

 Methods

Create an instance of the class with the input file

__construct(\SimplePie_Content_Type_Sniffer $file) 

Parameters

$file

\SimplePie_Content_Type_Sniffer

Input file

Sniff HTML

feed_or_html() : string

Returns

stringActual Content-Type

Get the Content-Type of the specified file

get_type() : string

Returns

stringActual Content-Type

Sniff images

image() : string

Returns

stringActual Content-Type

Sniff text or binary

text_or_binary() : string

Returns

stringActual Content-Type

Sniff unknown

unknown() : string

Returns

stringActual Content-Type

 Properties

 

File object

$file : \SimplePie_File

Default