protected function MailMIME::attachRegex in Mail MIME 6
Same name and namespace in other branches
- 8.2 mailmime.inc \MailMIME::attachRegex()
 - 6.2 mailmime.inc \MailMIME::attachRegex()
 - 7.2 mailmime.inc \MailMIME::attachRegex()
 - 7 mailmime.inc \MailMIME::attachRegex()
 
A preg_replace_callback used to attach local files, if possible.
See also
get()
File
- ./
mailmime.inc, line 383  - Provides the MailMIME class for creating MIME-formatted email messages.
 
Class
- MailMIME
 - The MailMIME class is used to create MIME email messages.
 
Code
protected function attachRegex($matches) {
  if (($url = filter_xss_bad_protocol($matches[4], FALSE)) && ($path = url_to_realpath($url)) && file_exists($path) && $this
    ->addHTMLImage($path)) {
    // The parent method will replace this with the actual cid: string.
    $matches[4] = $path;
  }
  return implode('', array_slice($matches, 1));
}