WordPress at Your Fingertips
function is not described

SimplePie_IRI::is_valid() public WP 1.0

Check if the object represents a valid IRI. This needs to be done on each call as some things change depending on another part of the IRI.

{} It's a method of the class: SimplePie_IRI{}

No Hooks.

Return

true|false.

Usage

$SimplePie_IRI = new SimplePie_IRI();
$SimplePie_IRI->is_valid();

Code of SimplePie_IRI::is_valid() WP 5.8.2

public function is_valid()
{
	if ($this->ipath === '') return true;

	$isauthority = $this->iuserinfo !== null || $this->ihost !== null ||
		$this->port !== null;
	if ($isauthority && $this->ipath[0] === '/') return true;

	if (!$isauthority && (substr($this->ipath, 0, 2) === '//')) return false;

	// Relative urls cannot have a colon in the first path segment (and the
	// slashes themselves are not included so skip the first character).
	if (!$this->scheme && !$isauthority &&
	    strpos($this->ipath, ':') !== false &&
	    strpos($this->ipath, '/', 1) !== false &&
	    strpos($this->ipath, ':') < strpos($this->ipath, '/', 1)) return false;

	return true;
}