You are here

function nofollowlist_preprocess_link in Nofollow List 7

Implements hook_preprocess_link().

1 string reference to 'nofollowlist_preprocess_link'
nofollowlist_theme_registry_alter in ./nofollowlist.module
Implements hook_theme_registry_alter().

File

./nofollowlist.module, line 39
Provides a nofollowlist filter.

Code

function nofollowlist_preprocess_link(&$vars, $hook) {
  $url = parse_url($vars['path']);
  $option = variable_get('nofollowlist_option', 'black');
  $hosts = variable_get('nofollowlist_hosts', '');
  $host_list = preg_split('/\\s+/', $hosts);
  if (isset($url['host'])) {
    if (_nofollowlist_is_nofollow($url['host'], $host_list, $option)) {
      $vars['options']['attributes']['rel'] = 'nofollow';
    }
  }
}