Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

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: 657 lines (25 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: Sanitize  - X-Ref

Used for data cleanup and post-processing

This class can be overloaded with {@see \SimplePie\SimplePie::set_sanitize_class()}

__construct()   X-Ref
List of domains for which to force HTTPS.


remove_div($enable = true)   X-Ref
No description

set_image_handler($page = false)   X-Ref
No description

set_registry(\SimplePie\Registry $registry)   X-Ref
No description

pass_cache_data($enable_cache = true, $cache_location = './cache', $cache_name_function = 'md5', $cache_class = 'SimplePie\Cache', DataCache $cache = null)   X-Ref
No description

pass_file_data($file_class = 'SimplePie\File', $timeout = 10, $useragent = '', $force_fsockopen = false)   X-Ref
No description

strip_htmltags($tags = ['base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style'])   X-Ref
No description

encode_instead_of_strip($encode = false)   X-Ref
No description

rename_attributes($attribs = [])   X-Ref
No description

strip_attributes($attribs = ['bgsound', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc'])   X-Ref
No description

add_attributes($attribs = ['audio' => ['preload' => 'none'], 'iframe' => ['sandbox' => 'allow-scripts allow-same-origin'], 'video' => ['preload' => 'none']])   X-Ref
No description

strip_comments($strip = false)   X-Ref
No description

set_output_encoding($encoding = 'UTF-8')   X-Ref
No description

set_url_replacements($element_attribute = null)   X-Ref
Set element/attribute key/value pairs of HTML attributes
containing URLs that need to be resolved relative to the feed

Defaults to |a|@href, |area|@href, |audio|@src, |blockquote|@cite,
|del|@cite, |form|@action, |img|@longdesc, |img|@src, |input|@src,
|ins|@cite, |q|@cite, |source|@src, |video|@src

param: array|null $element_attribute Element/attribute key/value pairs, null for default

set_https_domains($domains)   X-Ref
Set the list of domains for which to force HTTPS.


is_https_domain($domain)   X-Ref
Check if the domain is in the list of forced HTTPS.


https_url($url)   X-Ref
Force HTTPS for selected Web sites.


sanitize($data, $type, $base = '')   X-Ref
No description

preprocess($html, $type)   X-Ref
No description

replace_urls($document, $tag, $attributes)   X-Ref
No description

do_strip_htmltags($match)   X-Ref
No description

strip_tag($tag, $document, $xpath, $type)   X-Ref
No description

strip_attr($attrib, $xpath)   X-Ref
No description

rename_attr($attrib, $xpath)   X-Ref
No description

add_attr($tag, $valuePairs, $document)   X-Ref
No description

get_cache($image_url = '')   X-Ref
Get a DataCache

param: string $image_url Only needed for BC, can be removed in SimplePie 2.0.0
return: DataCache