mirror of
https://bitbucket.org/jsuto/piler.git
synced 2025-06-22 16:23:18 +02:00
Improved sanitizing the restored emails
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
@ -12,6 +12,8 @@ class ModelMailMail extends Model {
|
||||
|
||||
if($to == "" || strlen($msg) < 30){ return $ok; }
|
||||
|
||||
$msg = $this->normalize_message($msg);
|
||||
|
||||
if(REWRITE_MESSAGE_ID == 1) {
|
||||
$msg = preg_replace("/Message-ID:([^\n]+)\n/i", "Message-ID: <" . generate_random_string(25) . '@' . SITE_NAME . ">\n", $msg);
|
||||
}
|
||||
@ -165,4 +167,8 @@ class ModelMailMail extends Model {
|
||||
}
|
||||
|
||||
|
||||
private function normalize_message($data = '') {
|
||||
$a = preg_split("/\r?\n/", $data);
|
||||
return implode("\r\n", $a);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user