SimplePie_Content_Type_Sniffer::image

Advertisement

Summery Summery

Sniff images

Syntax Syntax

SimplePie_Content_Type_Sniffer::image()

Return Return

(string) Actual Content-Type

Source Source

File: wp-includes/SimplePie/Content/Type/Sniffer.php

		elseif (substr($this->file->body, 0, 3) === "\xFF\xD8\xFF")
		{
			return 'image/jpeg';
		}
		elseif (substr($this->file->body, 0, 2) === "\x42\x4D")
		{
			return 'image/bmp';
		}
		elseif (substr($this->file->body, 0, 4) === "\x00\x00\x01\x00")
		{
			return 'image/vnd.microsoft.icon';
		}

		return false;
	}

	/**
	 * Sniff HTML
	 *
	 * @return string Actual Content-Type
	 */
	public function feed_or_html()
	{
		$len = strlen($this->file->body);
		$pos = strspn($this->file->body, "\x09\x0A\x0D\x20\xEF\xBB\xBF");

		while ($pos < $len)
		{

Advertisement

Advertisement

Leave a Reply