$url = $this->parser->parse($attr['href']);
$scheme = $url->getSchemeObj($config, $context);
- if ($scheme->browsable && !$url->isLocal($config, $context)) {
+ if (!is_null($url->host) && $scheme !== false && $scheme->browsable) {
if (isset($attr['rel'])) {
- $rels = explode(' ', $attr);
- if (!in_array('nofollow', $rels)) {
- $rels[] = 'nofollow';
- }
- $attr['rel'] = implode(' ', $rels);
+ $attr['rel'] .= ' nofollow';
} else {
$attr['rel'] = 'nofollow';
}