]> git.wh0rd.org - tt-rss.git/blobdiff - lib/htmlpurifier/library/HTMLPurifier/AttrTransform/Nofollow.php
Revert "Update HTML Purifier to version 4.4.0."
[tt-rss.git] / lib / htmlpurifier / library / HTMLPurifier / AttrTransform / Nofollow.php
index f7fb1209b3be74ddbd3e03f7bcec85a35abe0646..573b42c9c5a1b73abc09caef1e0bbf79f7e1daa6 100644 (file)
@@ -24,13 +24,9 @@ class HTMLPurifier_AttrTransform_Nofollow extends HTMLPurifier_AttrTransform
         $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';
             }