You are here

function spam_get_text in Spam 5.3

Same name and namespace in other branches
  1. 6 spam.module \spam_get_text()

Extract text from content array.

2 calls to spam_get_text()
bayesian_tokenize in filters/bayesian/bayesian.module
Split content into an array of tokens.
custom_spam_filter in filters/custom/custom.module
Apply enabled custom filter rules against content.

File

./spam.module, line 1745

Code

function spam_get_text($content, $type, $fields, $extra = array(), $full = TRUE) {
  if (is_object($content)) {
    $content = (array) $content;
  }
  $text = '';
  foreach ($fields['main'] as $field) {
    $text .= $content[$field] . ' ';
  }
  if ($full && is_array($fields['other'])) {
    foreach ($fields['other'] as $field) {
      $text .= $content[$field] . ' ';
    }
  }
  return $text;
}