SimplePie_IRI::is_valid

Advertisement

Summery Summery

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.

Syntax Syntax

SimplePie_IRI::is_valid()

Return Return

(bool)

Source Source

File: wp-includes/SimplePie/IRI.php

			$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;
	}

	/**
	 * Set the entire IRI. Returns true on success, false on failure (if there
	 * are any invalid characters).
	 *
	 * @param string $iri
	 * @return bool
	 */
	public function set_iri($iri, $clear_cache = false)

Advertisement

Advertisement

Leave a Reply