Revert strict comparison on mimeType

This commit is contained in:
Hadi Nategh 2021-10-08 13:05:06 +02:00
parent 0812bfaa79
commit 7da0ae68e3

View File

@ -1329,7 +1329,7 @@ class mail_compose
$etpl = new Etemplate('mail.compose'); $etpl = new Etemplate('mail.compose');
$etpl->setElementAttribute('composeToolbar', 'actions', self::getToolbarActions($content)); $etpl->setElementAttribute('composeToolbar', 'actions', self::getToolbarActions($content));
if ($content['mimeType'] === 'html') if ($content['mimeType'] == 'html')
{ {
//mode="$cont[rtfEditorFeatures]" validation_rules="$cont[validation_rules]" base_href="$cont[upload_dir]" //mode="$cont[rtfEditorFeatures]" validation_rules="$cont[validation_rules]" base_href="$cont[upload_dir]"
$_htmlConfig = Mail::$htmLawed_config; $_htmlConfig = Mail::$htmLawed_config;
@ -1364,7 +1364,7 @@ class mail_compose
$preserv['list-id'] = $content['list-id'] ?? null; $preserv['list-id'] = $content['list-id'] ?? null;
$preserv['mode'] = $content['mode'] ?? null; $preserv['mode'] = $content['mode'] ?? null;
// convert it back to checkbox expectations // convert it back to checkbox expectations
if($content['mimeType'] === 'html') { if($content['mimeType'] == 'html') {
$content['mimeType']=1; $content['mimeType']=1;
} else { } else {
$content['mimeType']=0; $content['mimeType']=0;
@ -2522,7 +2522,9 @@ class mail_compose
if ($_formData['attachments'] && $_formData['filemode'] != Vfs\Sharing::ATTACH && !$_autosaving) if ($_formData['attachments'] && $_formData['filemode'] != Vfs\Sharing::ATTACH && !$_autosaving)
{ {
$attachment_links = $this->_getAttachmentLinks($_formData['attachments'], $_formData['filemode'], $attachment_links = $this->_getAttachmentLinks($_formData['attachments'], $_formData['filemode'],
$_formData['mimeType'] === 'html', // @TODO: $content['mimeType'] could type string/boolean. At the moment we can't strictly check them :(.
// @TODO: This needs to be fixed in compose function to get the right type from the content.
$_formData['mimeType'] == 'html',
array_unique(array_merge((array)$_formData['to'], (array)$_formData['cc'], (array)$_formData['bcc'])), array_unique(array_merge((array)$_formData['to'], (array)$_formData['cc'], (array)$_formData['bcc'])),
$_formData['expiration'], $_formData['password']); $_formData['expiration'], $_formData['password']);
} }