You are here

function spamspan in SpamSpan filter 7

Same name and namespace in other branches
  1. 8.2 spamspan.module \spamspan()
  2. 8 spamspan.module \spamspan()
  3. 5 spamspan.module \spamspan()
  4. 6 spamspan.module \spamspan()

A simple utility function wrapping the main processing callback. This function may be called by other modules and themes.

Parameters

$text: Text, maybe containing email addresses.

$settings: An associative array of settings to be applied.

Return value

The input text with emails replaced by spans

4 calls to spamspan()
SpamspanTestCase::_assert in ./spamspan.test
SpamspanTestCase::_assert_at_dot in ./spamspan.test
SpamspanTestCase::_assert_form in ./spamspan.test
spamspan_admin_page::form in ./spamspan_admin_page.php
Return the admin page. External text should be checked: = array('#markup' => check_plain($format->name));
5 string references to 'spamspan'
SpamspanTestCase::setUp in ./spamspan.test
Sets up a Drupal site for running functional and integration tests.
SpamspanTestCase::testSpamspan in ./spamspan.test
spamspan_admin_page in ./spamspan.module
menu(): 'page arguments' => array('spamspan_admin_page'),
spamspan_admin_page_submit in ./spamspan.module
.
theme_spamspan_at_sign in ./spamspan.module

File

./spamspan.module, line 278
This module implements the spamspan technique (http://www.spamspan.com ) for hiding email addresses from spambots.

Code

function spamspan($text = '', $settings = array()) {

  //apply default settings
  $info = filter_get_filters();
  $defaults = $info['spamspan']['default settings'];

  //create a dummy filter object so we can apply the settings
  $filter = new stdClass();
  $filter->settings = $settings + $defaults;
  return _spamspan_filter_process($text, $filter);
}