diff --git a/wysiwyg_filter.pages.inc b/wysiwyg_filter.pages.inc index 40b5e3e..e5e6d0a 100644 --- a/wysiwyg_filter.pages.inc +++ b/wysiwyg_filter.pages.inc @@ -444,7 +444,12 @@ function _wysiwyg_filter_xss_attributes($attr, $element = '') { break; } } - if (($nofollow_policy == 'blacklist' && $domain_found) || ($nofollow_policy == 'whitelist' && !$domain_found)) { + // If we are doing a blacklist and found the domain, add a nofollow. + // If we are doing a whitelist and didn't find the domain AND it is + // not a relative link, add nofollow. Relative links are + // detected by not having '://'. + $link_is_relative = strpos($attrinfo['value'], '://') === FALSE; + if (($nofollow_policy == 'blacklist' && $domain_found) || ($nofollow_policy == 'whitelist' && !$domain_found && !$link_is_relative)) { $add_nofollow = TRUE; } }