public function SpamspanTrait::replaceMailtoLinks in SpamSpan filter 8
Same name and namespace in other branches
- 8.2 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\spamspanCode
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);
}