You are here

protected function MailMIME::attachRegex in Mail MIME 8.2

Same name and namespace in other branches
  1. 6.2 mailmime.inc \MailMIME::attachRegex()
  2. 6 mailmime.inc \MailMIME::attachRegex()
  3. 7.2 mailmime.inc \MailMIME::attachRegex()
  4. 7 mailmime.inc \MailMIME::attachRegex()

A preg_replace_callback used to attach local files, if possible.

See also

get()

File

./mailmime.inc, line 436
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 = drupal_strip_dangerous_protocols($matches[4])) && ($path = url_to_realpath($url)) && is_file($path) && $this
    ->addHTMLImage($path)) {

    // The parent method will replace this with the actual cid: string.
    $matches[4] = $path;
  }
  return implode('', array_slice($matches, 1));
}