mirror of
https://bitbucket.org/jsuto/piler.git
synced 2025-06-22 16:13:17 +02:00
Sanitize emails after retrieving the from archive by adding proper CRLF line termination
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
@ -40,6 +40,12 @@ class ModelSearchMessage extends Model {
|
||||
}
|
||||
|
||||
|
||||
private function normalize_message($data = '') {
|
||||
$a = preg_split("/\r?\n/", $data);
|
||||
return implode("\r\n", $a);
|
||||
}
|
||||
|
||||
|
||||
public function get_raw_message($id = '') {
|
||||
$s = '';
|
||||
|
||||
@ -65,6 +71,8 @@ class ModelSearchMessage extends Model {
|
||||
$this->verification = $this->verify_message($id, $s);
|
||||
}
|
||||
|
||||
$s = $this->normalize_message($s);
|
||||
|
||||
if(Registry::get('auditor_user') == 0 && HEADER_LINE_TO_HIDE) {
|
||||
$s = preg_replace("/" . HEADER_LINE_TO_HIDE . ".{1,}(\n(\ |\t){1,}.{1,}){0,}" . "\n/i", "", $s);
|
||||
}
|
||||
|
Reference in New Issue
Block a user