You are here

function messaging_htmlmail_parse_boundary in Messaging 7

File

messaging_htmlmail/messaging_htmlmail.inc, line 502
Drupal Messaging Framework - Send_Method class file

Code

function messaging_htmlmail_parse_boundary($part) {
  $m = array();
  if (preg_match('/.*boundary="?([^";]+)"?.*/', $part['headers']['Content-Type'], $m)) {
    $boundary = "\n--" . $m[1];
    $body = str_replace("{$boundary}--", '', $part['body']);
    return array_slice(explode($boundary, $body), 1);
  }
  return array(
    $part['body'],
  );
}