mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
Change type to mime_type.
This commit is contained in:
@@ -1449,35 +1449,35 @@ function number_pad($number,$n) {
|
|||||||
//set the mime type
|
//set the mime type
|
||||||
switch (substr($attachment['name'], -4)) {
|
switch (substr($attachment['name'], -4)) {
|
||||||
case ".png":
|
case ".png":
|
||||||
$attachment['type'] = 'image/png';
|
$attachment['mime_type'] = 'image/png';
|
||||||
break;
|
break;
|
||||||
case ".pdf":
|
case ".pdf":
|
||||||
$attachment['type'] = 'application/pdf';
|
$attachment['mime_type'] = 'application/pdf';
|
||||||
break;
|
break;
|
||||||
case ".mp3":
|
case ".mp3":
|
||||||
$attachment['type'] = 'audio/mpeg';
|
$attachment['mime_type'] = 'audio/mpeg';
|
||||||
break;
|
break;
|
||||||
case ".wav":
|
case ".wav":
|
||||||
$attachment['type'] = 'audio/wav';
|
$attachment['mime_type'] = 'audio/x-wav';
|
||||||
break;
|
break;
|
||||||
case ".opus":
|
case ".opus":
|
||||||
$attachment['type'] = 'audio/opus';
|
$attachment['mime_type'] = 'audio/opus';
|
||||||
break;
|
break;
|
||||||
case ".ogg":
|
case ".ogg":
|
||||||
$attachment['type'] = 'audio/ogg';
|
$attachment['mime_type'] = 'audio/ogg';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//add the attachments
|
//add the attachments
|
||||||
if ($attachment['type'] == 'file' || $attachment['type'] == 'path') {
|
if ($attachment['type'] == 'file' || $attachment['type'] == 'path') {
|
||||||
$mail->AddAttachment($attachment['value'], $attachment['name'], null, $attachment['type']);
|
$mail->AddAttachment($attachment['value'], $attachment['name'], 'base64', $attachment['mime_type']);
|
||||||
}
|
}
|
||||||
else if ($attachment['type'] == 'string') {
|
else if ($attachment['type'] == 'string') {
|
||||||
if (base64_encode(base64_decode($attachment['value'], true)) === $attachment['value']) {
|
if (base64_encode(base64_decode($attachment['value'], true)) === $attachment['value']) {
|
||||||
$mail->AddStringAttachment(base64_decode($attachment['value']), $attachment['name'], 'base64', $attachment['type']);
|
$mail->AddStringAttachment(base64_decode($attachment['value']), $attachment['name'], 'base64', $attachment['mime_type']);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$mail->AddStringAttachment($attachment['value'], $attachment['name'], 'base64', $attachment['type']);
|
$mail->AddStringAttachment($attachment['value'], $attachment['name'], 'base64', $attachment['mime_type']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user