|
|
@ -498,15 +498,23 @@ foreach($index->search('') |
|
|
|
|
|
|
|
|
|
|
|
if ($url = $value->attr($settings->attribute)) |
|
|
|
if ($url = $value->attr($settings->attribute)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
//Make relative links absolute |
|
|
|
// Convert relative links to absolute |
|
|
|
$url = \Yggverse\YoTools\Link::relative2absolute( |
|
|
|
$address = new \Yggverse\Net\Address( |
|
|
|
$document->get('url'), |
|
|
|
$url |
|
|
|
$url, |
|
|
|
); |
|
|
|
$scheme, |
|
|
|
|
|
|
|
$host, |
|
|
|
if ($address->isRelative()) |
|
|
|
$port, |
|
|
|
{ |
|
|
|
|
|
|
|
$base = new \Yggverse\Net\Address( |
|
|
|
|
|
|
|
$document->get('url') |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($absolute = $address->getAbsolute($base)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$url = $absolute; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Regex rules |
|
|
|
// Regex rules |
|
|
|
if (!preg_match($settings->regex, $url)) |
|
|
|
if (!preg_match($settings->regex, $url)) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -514,7 +522,7 @@ foreach($index->search('') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// External host rules |
|
|
|
// 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; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|