public static function filterTag(Tag $tag, TagStack $tagStack, array $hosts, array $sites, $cacheDir)
	{
		// Always invalidate this tag
		$tag->invalidate();

		if ($tag->hasAttribute('url'))
		{
			$url    = $tag->getAttribute('url');
			$siteId = self::getSiteIdFromUrl($url, $hosts);
			if (isset($sites[$siteId]))
			{
				$attributes = self::getAttributes($url, $sites[$siteId], $cacheDir);
				if (!empty($attributes))
				{
					self::createTag(strtoupper($siteId), $tagStack, $tag)->setAttributes($attributes);
				}
			}
		}
	}
public static function filterTag(Tag $tag, TagStack $tagStack, array $hosts, array $sites, $cacheDir)
	{
		// Always invalidate this tag
		$tag->invalidate();

		if ($tag->hasAttribute('url'))
		{
			$url    = $tag->getAttribute('url');
			$siteId = self::getSiteIdFromUrl($url, $hosts);
			if (isset($sites[$siteId]))
			{
				$attributes = self::getAttributes($url, $sites[$siteId], $cacheDir);
				if (!empty($attributes))
				{
					self::createTag(strtoupper($siteId), $tagStack, $tag)->setAttributes($attributes);
				}
			}
		}
	}
public static function filterTag ( Tag $ tag , TagStack $ tagStack , array $ hosts , array $ sites , $ cacheDir ) { // Always invalidate this tag $ tag -> invalidate ( ) ; if ( $ tag -> hasAttribute ( 'url' ) ) { $ url = $ tag -> getAttribute ( 'url' ) ; $ siteId = self :: getSiteIdFromUrl ( $ url , $ hosts ) ; if ( isset ( $ sites [ $ siteId ] ) ) { $ attributes = self :: getAttributes ( $ url , $ sites [ $ siteId ] , $ cacheDir ) ; if ( ! empty ( $ attributes ) ) { self :: createTag ( strtoupper ( $ siteId ) , $ tagStack , $ tag ) -> setAttributes ( $ attributes ) ; } } } }
Filter a MEDIA tag

This will always invalidate the original tag, and possibly replace it with the tag that
corresponds to the media site

@param  Tag         $tag      The original tag
@param  TagStack    $tagStack Parser instance, so that we can add the new tag to the stack
@param  array       $hosts    Map of [hostname => siteId]
@param  array       $sites    Map of [siteId => siteConfig]
@param  string|null $cacheDir Path to the cache directory
@return void
Filter a MEDIA tag