mirror of
https://github.com/YGGverse/Yo.git
synced 2026-03-31 17:55:35 +00:00
update yggverse/net version
This commit is contained in:
parent
4507eb4530
commit
982d1f1246
2 changed files with 18 additions and 10 deletions
|
|
@ -498,15 +498,23 @@ foreach($index->search('')
|
|||
|
||||
if ($url = $value->attr($settings->attribute))
|
||||
{
|
||||
//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($settings->regex, $url))
|
||||
{
|
||||
|
|
@ -514,7 +522,7 @@ foreach($index->search('')
|
|||
}
|
||||
|
||||
// External host rules
|
||||
if (!$settings->external && parse_url($url, PHP_URL_HOST) != $host)
|
||||
if (!$settings->external && parse_url($url, PHP_URL_HOST) != $address->getHost())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue