Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401] [Versions 400 and 401] [Versions 401 and 402] [Versions 401 and 403]

SimplePie A PHP-Based RSS and Atom Feed Framework. Takes the hard work out of managing a complete RSS/Atom solution.

Author: Ryan Parman
Author: Sam Sneddon
Author: Ryan McCue
Copyright: 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
License: http://www.opensource.org/licenses/bsd-license.php BSD License
File Size: 320 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

SimplePie_Content_Type_Sniffer:: (6 methods):
  __construct()
  get_type()
  text_or_binary()
  unknown()
  image()
  feed_or_html()


Class: SimplePie_Content_Type_Sniffer  - X-Ref

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 {@see SimplePie::set_content_type_sniffer_class()}

__construct($file)   X-Ref
Create an instance of the class with the input file

param: SimplePie_Content_Type_Sniffer $file Input file

get_type()   X-Ref
Get the Content-Type of the specified file

return: string Actual Content-Type

text_or_binary()   X-Ref
Sniff text or binary

return: string Actual Content-Type

unknown()   X-Ref
Sniff unknown

return: string Actual Content-Type

image()   X-Ref
Sniff images

return: string Actual Content-Type

feed_or_html()   X-Ref
Sniff HTML

return: string Actual Content-Type