SimplePie::sanitize()publicWP 1.0

Sanitize feed data

Method of the class: SimplePie{}

Internal function — this function is designed to be used by the kernel itself. It is not recommended to use this function in your code.

No Hooks.

Return

String. Sanitized data

Usage

$SimplePie = new SimplePie();
$SimplePie->sanitize( $data, $type, $base );
$data(string) (required)
Data to sanitize
$type(int) (required)
One of the SIMPLEPIE_CONSTRUCT_* constants
$base(string)
Base URL to resolve URLs against
Default: ''

Notes

  • See: SimplePie_Sanitize::sanitize()

SimplePie::sanitize() code WP 6.5.2

public function sanitize($data, $type, $base = '')
{
	try
	{
		return $this->sanitize->sanitize($data, $type, $base);
	}
	catch (SimplePie_Exception $e)
	{
		if (!$this->enable_exceptions)
		{
			$this->error = $e->getMessage();
			$this->registry->call('Misc', 'error', array($this->error, E_USER_WARNING, $e->getFile(), $e->getLine()));
			return '';
		}

		throw $e;
	}
}