Sanitize
Used for data cleanup and post-processing
This class can be overloaded with {@see \SimplePie\SimplePie::set_sanitize_class()}
- Full name:
\SimplePie\Sanitize
- This class implements:
\SimplePie\RegistryAware
Properties
base
remove_div
image_handler
strip_htmltags
encode_instead_of_strip
strip_attributes
rename_attributes
add_attributes
strip_comments
output_encoding
enable_cache
cache_location
cache_name_function
cache_namefilter
timeout
useragent
force_fsockopen
replace_url_attributes
registry
cache
cache_duration
https_domains
List of domains for which to force HTTPS.
See Also:
- \SimplePie\Sanitize::set_https_domains() - Array is a tree split at DNS levels. Example: array('biz' => true, 'com' => array('example' => true), 'net' => array('example' => array('www' => true)))
Methods
__construct
remove_div
Parameters:
Parameter | Type | Description |
---|---|---|
$enable |
mixed |
set_image_handler
Parameters:
Parameter | Type | Description |
---|---|---|
$page |
mixed |
set_registry
Set the Registry into the class
Parameters:
Parameter | Type | Description |
---|---|---|
$registry |
\SimplePie\Registry |
pass_cache_data
public pass_cache_data(mixed $enable_cache = true, mixed $cache_location = './cache', mixed $cache_name_function = 'md5', mixed $cache_class = 'SimplePieCache', \SimplePie\Cache\DataCache $cache = null): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$enable_cache |
mixed | |
$cache_location |
mixed | |
$cache_name_function |
mixed | |
$cache_class |
mixed | |
$cache |
\SimplePie\Cache\DataCache |
pass_file_data
public pass_file_data(mixed $file_class = 'SimplePieFile', mixed $timeout = 10, mixed $useragent = '', mixed $force_fsockopen = false): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$file_class |
mixed | |
$timeout |
mixed | |
$useragent |
mixed | |
$force_fsockopen |
mixed |
strip_htmltags
public strip_htmltags(mixed $tags = ['base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style']): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$tags |
mixed |
encode_instead_of_strip
Parameters:
Parameter | Type | Description |
---|---|---|
$encode |
mixed |
rename_attributes
Parameters:
Parameter | Type | Description |
---|---|---|
$attribs |
mixed |
strip_attributes
public strip_attributes(mixed $attribs = ['bgsound', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc']): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$attribs |
mixed |
add_attributes
public add_attributes(mixed $attribs = ['audio' => ['preload' => 'none'], 'iframe' => ['sandbox' => 'allow-scripts allow-same-origin'], 'video' => ['preload' => 'none']]): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$attribs |
mixed |
strip_comments
Parameters:
Parameter | Type | Description |
---|---|---|
$strip |
mixed |
set_output_encoding
Parameters:
Parameter | Type | Description |
---|---|---|
$encoding |
mixed |
set_url_replacements
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
Parameters:
Parameter | Type | Description |
---|---|---|
$element_attribute |
array|null | Element/attribute key/value pairs, null for default |
set_https_domains
Set the list of domains for which to force HTTPS.
Parameters:
Parameter | Type | Description |
---|---|---|
$domains |
mixed |
See Also:
- \SimplePie\Misc::https_url() - Example array('biz', 'example.com', 'example.org', 'www.example.net');
is_https_domain
Check if the domain is in the list of forced HTTPS.
Parameters:
Parameter | Type | Description |
---|---|---|
$domain |
mixed |
https_url
Force HTTPS for selected Web sites.
Parameters:
Parameter | Type | Description |
---|---|---|
$url |
mixed |
sanitize
Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed | |
$type |
mixed | |
$base |
mixed |
preprocess
Parameters:
Parameter | Type | Description |
---|---|---|
$html |
mixed | |
$type |
mixed |
replace_urls
Parameters:
Parameter | Type | Description |
---|---|---|
$document |
mixed | |
$tag |
mixed | |
$attributes |
mixed |
do_strip_htmltags
Parameters:
Parameter | Type | Description |
---|---|---|
$match |
mixed |
strip_tag
Parameters:
Parameter | Type | Description |
---|---|---|
$tag |
mixed | |
$document |
mixed | |
$xpath |
mixed | |
$type |
mixed |
strip_attr
Parameters:
Parameter | Type | Description |
---|---|---|
$attrib |
mixed | |
$xpath |
mixed |
rename_attr
Parameters:
Parameter | Type | Description |
---|---|---|
$attrib |
mixed | |
$xpath |
mixed |
add_attr
Parameters:
Parameter | Type | Description |
---|---|---|
$tag |
mixed | |
$valuePairs |
mixed | |
$document |
mixed |
get_cache
Get a DataCache
Parameters:
Parameter | Type | Description |
---|---|---|
$image_url |
string | Only needed for BC, can be removed in SimplePie 2.0.0 |
Automatically generated on 2025-03-18