encapsulate adaption of subject in function, and use it

This commit is contained in:
Klaus Leithoff 2013-08-27 07:56:46 +00:00
parent d5d6f4daf9
commit 9d5eb54b47

View File

@ -5227,6 +5227,19 @@ class felamimail_bo
return $message;
}
/**
* adaptSubjectForImport - strips subject from unwanted Characters, and does some normalization
* to meet expectations
* @param string $subject string to process
* @return string
*/
static function adaptSubjectForImport($subject)
{
$subject = str_replace('$$','__',($subject?$subject:lang('(no subject)')));
$subject = str_ireplace(array('[FWD]','[',']','{','}','<','>'),array('Fwd:',' ',' ',' ',' ',' ',' '),trim($subject));
return $subject;
}
/**
* processURL2InlineImages - parses a html text for images, and adds them as inline attachment
* we do not use the functionality of the phpmailer here, as phpmailers functionality requires