You are here

function mimemail_parse_boundary in Mime Mail 5

Same name and namespace in other branches
  1. 6 mimemail.inc \mimemail_parse_boundary()
  2. 7 includes/mimemail.incoming.inc \mimemail_parse_boundary()
1 call to mimemail_parse_boundary()
mimemail_parse in ./mimemail.inc

File

./mimemail.inc, line 401

Code

function mimemail_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'],
  );
}