You are here

function invisimail_encode_process in Invisimail 7

Process callback for all invisimail encoders.

This callback will route the text to be processed to the general processor, which in turn will route individual email addresses to the appropriate encoder.

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

File

./invisimail.module, line 86
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_process($text, $filter, $format, $langcode, $cache, $cache_id) {
  $encoder = invisimail_get_encoder($filter->settings['encoder']);
  if (function_exists($encoder['encode callback'])) {
    return invisimail_encode_string($text, $filter->settings['encoder'], $filter->settings);
  }
  elseif ($encoder['encode callback']) {

    // Process is required, so there's no default passthrough option here.
    watchdog('invisimail', 'Invalid encode callback: @callback', array(
      '@callback' => $encoder['encode callback'],
    ));
    return $text;
  }
}