Mail: Fix some remaining usages of mail_bo

see 2398968fb8
This commit is contained in:
nathangray 2020-06-09 14:19:21 -06:00
parent 03a5620ea9
commit 72affb6696

View File

@ -2792,13 +2792,13 @@ $filter['before']= date("d-M-Y", $cutoffdate2);
{ {
$headers = Horde_Mime_Headers::parseHeaders($message); $headers = Horde_Mime_Headers::parseHeaders($message);
$subject = str_replace('$$','__',Mail::decode_header($headers['SUBJECT'])); $subject = str_replace('$$','__',Mail::decode_header($headers['SUBJECT']));
$subject = mail_bo::clean_subject_for_filename($subject); $subject = Api\Mail::clean_subject_for_filename($subject);
Api\Header\Content::safe($message, $subject.".eml", $mime='message/rfc822', $size=0, true, true); Api\Header\Content::safe($message, $subject.".eml", $mime='message/rfc822', $size=0, true, true);
echo $message; echo $message;
} }
else else
{ {
$subject = mail_bo::clean_subject_for_filename($subject); $subject = Api\Mail::clean_subject_for_filename($subject);
Api\Header\Content::safe($message, $subject.".eml", $mime='text/html', $size=0, true, false); Api\Header\Content::safe($message, $subject.".eml", $mime='text/html', $size=0, true, false);
print '<pre>'. htmlspecialchars($message, ENT_NOQUOTES|ENT_SUBSTITUTE, 'utf-8') .'</pre>'; print '<pre>'. htmlspecialchars($message, ENT_NOQUOTES|ENT_SUBSTITUTE, 'utf-8') .'</pre>';
} }
@ -2882,11 +2882,11 @@ $filter['before']= date("d-M-Y", $cutoffdate2);
if (Vfs::is_dir($path)) if (Vfs::is_dir($path))
{ {
$headers = $this->mail_bo->getMessageHeader($uid,$partID,true,false,$mailbox); $headers = $this->mail_bo->getMessageHeader($uid,$partID,true,false,$mailbox);
$file = $dir . '/'.mail_bo::clean_subject_for_filename($headers['SUBJECT']).'.eml'; $file = $dir . '/'.Api\Mail::clean_subject_for_filename($headers['SUBJECT']).'.eml';
} }
else else
{ {
$file = $dir . '/' . mail_bo::clean_subject_for_filename(str_replace($dir.'/', '', $path)); $file = $dir . '/' . Api\Mail::clean_subject_for_filename(str_replace($dir.'/', '', $path));
} }
if ($savemode != 'overwrite') if ($savemode != 'overwrite')
@ -2958,7 +2958,7 @@ $filter['before']= date("d-M-Y", $cutoffdate2);
{ {
$dir = Vfs::dirname($path); $dir = Vfs::dirname($path);
// Need to deal with any ? here, or basename will truncate // Need to deal with any ? here, or basename will truncate
$filename = mail_bo::clean_subject_for_filename(str_replace('?','_',Vfs::basename($path))); $filename = Api\Mail::clean_subject_for_filename(str_replace('?','_',Vfs::basename($path)));
} }
if (!Vfs::is_writable($dir)) if (!Vfs::is_writable($dir))
@ -3155,7 +3155,7 @@ $filter['before']= date("d-M-Y", $cutoffdate2);
pathinfo($file['filename'], PATHINFO_EXTENSION); pathinfo($file['filename'], PATHINFO_EXTENSION);
} }
// Strip special characters to make sure the files are visible for all OS (windows has issues) // Strip special characters to make sure the files are visible for all OS (windows has issues)
$target_name = mail_bo::clean_subject_for_filename(iconv($file['charset'] ? $file['charset'] : $GLOBALS['egw_info']['server']['system_charset'], 'ASCII//IGNORE', $file['filename'])); $target_name = Api\Mail::clean_subject_for_filename(iconv($file['charset'] ? $file['charset'] : $GLOBALS['egw_info']['server']['system_charset'], 'ASCII//IGNORE', $file['filename']));
if (!($fp = Vfs::fopen($path.$target_name,'wb')) || if (!($fp = Vfs::fopen($path.$target_name,'wb')) ||
!(!fseek($attachment['attachment'], 0, SEEK_SET) && stream_copy_to_stream($attachment['attachment'], $fp))) !(!fseek($attachment['attachment'], 0, SEEK_SET) && stream_copy_to_stream($attachment['attachment'], $fp)))