mirror of
https://github.com/YGGverse/Yo.git
synced 2025-03-13 05:41:18 +00:00
update yggverse/net version api
This commit is contained in:
parent
989e277a1d
commit
f12c897d34
@ -311,15 +311,23 @@ foreach($index->search('')
|
||||
|
||||
if ($url = $link->getAddress())
|
||||
{
|
||||
//Make relative links absolute
|
||||
$url = \Yggverse\YoTools\Link::relative2absolute(
|
||||
$document->get('url'),
|
||||
$url,
|
||||
$scheme,
|
||||
$host,
|
||||
$port,
|
||||
// Convert relative links to absolute
|
||||
$address = new \Yggverse\Net\Address(
|
||||
$url
|
||||
);
|
||||
|
||||
if ($address->isRelative())
|
||||
{
|
||||
$base = new \Yggverse\Net\Address(
|
||||
$document->get('url')
|
||||
);
|
||||
|
||||
if ($absolute = $address->getAbsolute($base))
|
||||
{
|
||||
$url = $absolute;
|
||||
}
|
||||
}
|
||||
|
||||
// Regex rules
|
||||
if (!preg_match($config->cli->document->crawl->url->regex, $url))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user