You are here

public function SpamspanTrait::replaceMailtoLinks in SpamSpan filter 8.2

Same name and namespace in other branches
  1. 8 src/SpamspanTrait.php \Drupal\spamspan\SpamspanTrait::replaceMailtoLinks()
1 call to SpamspanTrait::replaceMailtoLinks()
FilterSpamspan::processAsText in src/Plugin/Filter/FilterSpamspan.php
Replaces email addresses using regex.

File

src/SpamspanTrait.php, line 63

Class

SpamspanTrait
Trait SpamspanTrait.

Namespace

Drupal\spamspan

Code

public function replaceMailtoLinks($text, &$altered = NULL) {
  $callback = function ($matches) use (&$altered) {
    $altered = TRUE;
    return $this
      ->callbackMailto($matches);
  };
  return preg_replace_callback(SpamspanInterface::PATTERN_MAILTO, $callback, $text);
}