Lines Matching refs:file

66 	var $file;  variable in SimplePie_Content_Type_Sniffer
71 * @param SimplePie_Content_Type_Sniffer $file Input file
73 public function __construct($file) argument
75 $this->file = $file;
85 if (isset($this->file->headers['content-type']))
87 if (!isset($this->file->headers['content-encoding'])
88 && ($this->file->headers['content-type'] === 'text/plain'
89 || $this->file->headers['content-type'] === 'text/plain; charset=ISO-8859-1'
90 || $this->file->headers['content-type'] === 'text/plain; charset=iso-8859-1'
91 || $this->file->headers['content-type'] === 'text/plain; charset=UTF-8'))
96 if (($pos = strpos($this->file->headers['content-type'], ';')) !== false)
98 $official = substr($this->file->headers['content-type'], 0, $pos);
102 $official = $this->file->headers['content-type'];
144 if (substr($this->file->body, 0, 2) === "\xFE\xFF"
145 || substr($this->file->body, 0, 2) === "\xFF\xFE"
146 || substr($this->file->body, 0, 4) === "\x00\x00\xFE\xFF"
147 || substr($this->file->body, 0, 3) === "\xEF\xBB\xBF")
151 elseif (preg_match('/[\x00-\x08\x0E-\x1A\x1C-\x1F]/', $this->file->body))
166 $ws = strspn($this->file->body, "\x09\x0A\x0B\x0C\x0D\x20");
167 if (strtolower(substr($this->file->body, $ws, 14)) === '<!doctype html'
168 || strtolower(substr($this->file->body, $ws, 5)) === '<html'
169 || strtolower(substr($this->file->body, $ws, 7)) === '<script')
173 elseif (substr($this->file->body, 0, 5) === '%PDF-')
177 elseif (substr($this->file->body, 0, 11) === '%!PS-Adobe-')
181 elseif (substr($this->file->body, 0, 6) === 'GIF87a'
182 || substr($this->file->body, 0, 6) === 'GIF89a')
186 elseif (substr($this->file->body, 0, 8) === "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A")
190 elseif (substr($this->file->body, 0, 3) === "\xFF\xD8\xFF")
194 elseif (substr($this->file->body, 0, 2) === "\x42\x4D")
198 elseif (substr($this->file->body, 0, 4) === "\x00\x00\x01\x00")
213 if (substr($this->file->body, 0, 6) === 'GIF87a'
214 || substr($this->file->body, 0, 6) === 'GIF89a')
218 elseif (substr($this->file->body, 0, 8) === "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A")
222 elseif (substr($this->file->body, 0, 3) === "\xFF\xD8\xFF")
226 elseif (substr($this->file->body, 0, 2) === "\x42\x4D")
230 elseif (substr($this->file->body, 0, 4) === "\x00\x00\x01\x00")
245 $len = strlen($this->file->body);
246 $pos = strspn($this->file->body, "\x09\x0A\x0D\x20\xEF\xBB\xBF");
250 switch ($this->file->body[$pos])
256 $pos += strspn($this->file->body, "\x09\x0A\x0D\x20", $pos);
267 if (substr($this->file->body, $pos, 3) === '!--')
270 if ($pos < $len && ($pos = strpos($this->file->body, '-->', $pos)) !== false)
279 elseif (substr($this->file->body, $pos, 1) === '!')
281 if ($pos < $len && ($pos = strpos($this->file->body, '>', $pos)) !== false)
290 elseif (substr($this->file->body, $pos, 1) === '?')
292 if ($pos < $len && ($pos = strpos($this->file->body, '?>', $pos)) !== false)
301 elseif (substr($this->file->body, $pos, 3) === 'rss'
302 || substr($this->file->body, $pos, 7) === 'rdf:RDF')
306 elseif (substr($this->file->body, $pos, 4) === 'feed')