You are here

function invisimail_encode_prepare in Invisimail 7

Prepare callback for all invisimail encoders.

This callback will route the text to the appropriate prepare callback for the appropriate encoder. If one is not specified it will return the text unaltered.

1 string reference to 'invisimail_encode_prepare'
invisimail_filter_info in ./invisimail.module
Implements hook_filter_info().

File

./invisimail.module, line 106
This module provides a filter that will search content for email addresses and replace them with their ascii equivalents before display. This is not a complete protection from spam harvesters, but it is some help.

Code

function invisimail_encode_prepare($text, $filter, $format, $langcode, $cache, $cache_id) {
  $encoder = invisimail_get_encoder($filter->settings['encoder']);
  if (function_exists($encoder['prepare callback'])) {
    return $encoder['prepare callback']($text, $filter, $format, $langcode, $cache, $cache_id);
  }
  elseif ($encoder['prepare callback']) {
    watchdog('invisimail', 'Invalid prepare callback: @callback', array(
      '@callback' => $encoder['prepare callback'],
    ));
  }
  else {
    return $text;
  }
}