wp-includes/SimplePie/src/Sanitize.php:34Used for data cleanup and post-processing
$basestringpublic$remove_divboolpublic$image_handlerstringpublic$strip_htmltagsstring[]public$encode_instead_of_stripboolpublic$strip_attributesstring[]public$rename_attributesstring[]public$add_attributesSimplePie\array<string,public$strip_commentsboolpublic$output_encodingstringpublic$enable_cacheboolpublic$cache_locationstringpublic$cache_name_functionSimplePie\string&(callable(string):public$cache_namefilterSimplePie\Cache\NameFilterprivate$timeoutintpublic$useragentstringpublic$force_fsockopenboolpublic$replace_url_attributesSimplePie\array<string,public$curl_optionsSimplePie\array<int,private$registrySimplePie\Registrypublic$cacheSimplePie\Cache\DataCache|nullprivate$cache_durationintprivate$https_domainstrue|SimplePie\array<string,public$http_clientSimplePie\HTTP\Client|nullprivateclass Sanitize implements RegistryAware{ // Private vars /** @var string */ public $base = ''; // Options /** @var bool */ public $remove_div = true; /** @var string */ public $image_handler = ''; /** @var string[] */ public $strip_htmltags = ['base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style']; /** @var bool */ public $encode_instead_of_strip = false; /** @var string[] */ public $strip_attributes = ['bgsound', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc']; /** @var string[] */ public $rename_attributes = []; /** @var array<string, array<string, string>> */ public $add_attributes = ['audio' => ['preload' => 'none'], 'iframe' => ['sandbox' => 'allow-scripts allow-same-origin'], 'video' => ['preload' => 'none']]; /** @var bool */ public $strip_comments = false; /** @var string */ public $output_encoding = 'UTF-8'; /** @var bool */ public $enable_cache = true; /** @var string */ public $cache_location = './cache'; /** @var string&(callable(string): string) */ public $cache_name_function = 'md5'; /** * @var NameFilter */ private $cache_namefilter; /** @var int */ public $timeout = 10; /** @var string */ public $useragent = ''; /** @var bool */ public $force_fsockopen = false; /** @var array<string, string|string[]> */ public $replace_url_attributes = []; /** * @var array<int, mixed> Custom curl options * @see SimplePie::set_curl_options() */ private $curl_options = []; /** @var Registry */ public $registry; /** * @var DataCache|null */ private $cache = null; /** * @var int Cache duration (in seconds) */ private $cache_duration = 3600; /** * List of domains for which to force HTTPS. * @see \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))) * @var true|array<string, true|array<string, true|array<string, array<string, true|array<string, true|array<string, true>>>>>> */ public $https_domains = []; /** * @var Client|null */ private $http_client = null; public function __construct() { // Set defaults2 changes between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
set_http_client() added.verified against sourceget_http_client() added.verified against sourcesrc/wp-includes/SimplePie/src/Sanitize.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.