public function SpamspanTrait::replaceBareEmailAddresses in SpamSpan filter 8.2
Same name and namespace in other branches
- 8 src/SpamspanTrait.php \Drupal\spamspan\SpamspanTrait::replaceBareEmailAddresses()
1 call to SpamspanTrait::replaceBareEmailAddresses()
- FilterSpamspan::processAsText in src/
Plugin/ Filter/ FilterSpamspan.php - Replaces email addresses using regex.
File
- src/
SpamspanTrait.php, line 31
Class
- SpamspanTrait
- Trait SpamspanTrait.
Namespace
Drupal\spamspanCode
public function replaceBareEmailAddresses($text, &$altered = NULL) {
$callback = function ($matches) use (&$altered) {
$altered = TRUE;
return $this
->callbackBareEmailAddresses($matches);
};
return preg_replace_callback(SpamspanInterface::PATTERN_EMAIL_BARE, $callback, $text);
}