You are here

protected function FilterSpamspan::processAsText in SpamSpan filter 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Filter/FilterSpamspan.php \Drupal\spamspan\Plugin\Filter\FilterSpamspan::processAsText()

Replaces email addresses using regex.

Parameters

string $text: Input text.

bool $altered: Set to true if any replacements happen.

Return value

string Output text.

1 call to FilterSpamspan::processAsText()
FilterSpamspan::process in src/Plugin/Filter/FilterSpamspan.php
Performs the filter processing.

File

src/Plugin/Filter/FilterSpamspan.php, line 127

Class

FilterSpamspan
Provides a filter to obfuscate email addresses.

Namespace

Drupal\spamspan\Plugin\Filter

Code

protected function processAsText($text, &$altered) {
  $text = $this
    ->replaceMailtoLinks($text, $altered);
  if (!empty($this->settings['spamspan_use_form'])) {
    $text = $this
      ->replaceEmailAddressesWithOptions($text, $altered);
  }
  $text = $this
    ->replaceBareEmailAddresses($text, $altered);
  return $text;
}