mirror of
https://github.com/YGGverse/Yo.git
synced 2025-03-13 05:41:18 +00:00
fix undefined variable, minor optimization
This commit is contained in:
parent
f12c897d34
commit
0559ae3a58
@ -301,6 +301,10 @@ foreach($index->search('')
|
||||
);
|
||||
|
||||
// Crawl links
|
||||
$base = new \Yggverse\Net\Address(
|
||||
$document->get('url')
|
||||
);
|
||||
|
||||
$documents = [];
|
||||
|
||||
foreach ($body->getLinks() as $line)
|
||||
@ -318,10 +322,6 @@ foreach($index->search('')
|
||||
|
||||
if ($address->isRelative())
|
||||
{
|
||||
$base = new \Yggverse\Net\Address(
|
||||
$document->get('url')
|
||||
);
|
||||
|
||||
if ($absolute = $address->getAbsolute($base))
|
||||
{
|
||||
$url = $absolute;
|
||||
@ -335,7 +335,7 @@ foreach($index->search('')
|
||||
}
|
||||
|
||||
// External host rules
|
||||
if (!$config->cli->document->crawl->url->external && parse_url($url, PHP_URL_HOST) != $host)
|
||||
if (!$config->cli->document->crawl->url->external && $address->getHost() != $base->getHost())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user