SimplePie_Locator::extension

Advertisement

Syntax Syntax

SimplePie_Locator::extension( $array )

Source Source

File: wp-includes/SimplePie/Locator.php

	}

	public function get_rel_link($rel)
	{
		if ($this->dom === null)
		{
			throw new SimplePie_Exception('DOMDocument not found, unable to use '.
			                              'locator');
		}
		if (!class_exists('DOMXpath'))
		{
			throw new SimplePie_Exception('DOMXpath not found, unable to use '.
			                              'get_rel_link');
		}

		$xpath = new DOMXpath($this->dom);
		$query = '//a[@rel and @href] | //link[@rel and @href]';
		foreach ($xpath->query($query) as $link)
		{
			$href = trim($link->getAttribute('href'));
			$parsed = $this->registry->call('Misc', 'parse_url', array($href));
			if ($parsed['scheme'] === '' ||
			    preg_match('/^https?$/i', $parsed['scheme']))
			{
				if (method_exists($link, 'getLineNo') &&
				    $this->base_location < $link->getLineNo())
				{
					$href =

Advertisement

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.