Skip to content
Snippets Groups Projects
Commit d6c9ce80 authored by Jared Hancock's avatar Jared Hancock
Browse files

pipe: Decode address lists names after parsing emails

Otherwise, if a decoded email name has a comma in it, for instance

From: =?utf-8?B?RnJ5ZGVubHVuZCBIeW3DuGxsZXIsIEJldHRpbmE=?=
    <bettina.frydenlundhymoller@domain.com>

The address list will be parsed incorrectly since the comma has an ambiguous
significance. Usually, the personal name would be quoted; however, since it
is encoded, there is no need to quote it.
parent 7d24ddee
No related branches found
No related tags found
No related merge requests found
...@@ -40,7 +40,7 @@ class Mail_Parse { ...@@ -40,7 +40,7 @@ class Mail_Parse {
$this->charset = $charset; $this->charset = $charset;
$this->include_bodies = true; $this->include_bodies = true;
$this->decode_headers = true; $this->decode_headers = false;
$this->decode_bodies = true; $this->decode_bodies = true;
//Desired charset //Desired charset
...@@ -233,7 +233,7 @@ class Mail_Parse { ...@@ -233,7 +233,7 @@ class Mail_Parse {
} }
function getSubject(){ function getSubject(){
return $this->struct->headers['subject']; return Format::mimedecode($this->struct->headers['subject'], $this->charset);
} }
function getReplyTo() { function getReplyTo() {
...@@ -486,6 +486,10 @@ class Mail_Parse { ...@@ -486,6 +486,10 @@ class Mail_Parse {
if(PEAR::isError($parsed)) if(PEAR::isError($parsed))
return array(); return array();
foreach ($parsed as $p) {
$p->personal = Format::mimedecode($p->personal, $this->charset);
}
return $parsed; return $parsed;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment