diff options
author | Michael <icarus@dabo.de> | 2012-02-24 07:11:26 +0100 |
---|---|---|
committer | Michael <icarus@dabo.de> | 2012-02-24 07:11:26 +0100 |
commit | f6320f3319a8009c7bdf51035b226f0ea688d8bd (patch) | |
tree | cbe6bc39a2c5cceb9dcd8b25eaf3a58029114512 /include/Scrape.php | |
parent | 484a442f2b1072fe714174f4f782aa7d15818e72 (diff) | |
download | volse-hubzilla-f6320f3319a8009c7bdf51035b226f0ea688d8bd.tar.gz volse-hubzilla-f6320f3319a8009c7bdf51035b226f0ea688d8bd.tar.bz2 volse-hubzilla-f6320f3319a8009c7bdf51035b226f0ea688d8bd.zip |
Encoding for incoming mails. Fixed invalid message id (with side effect at the moment). Sending mail as text mail. Encoding name when importing mail contact.
Diffstat (limited to 'include/Scrape.php')
-rwxr-xr-x | include/Scrape.php | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/include/Scrape.php b/include/Scrape.php index 52405ae2d..e98978f38 100755 --- a/include/Scrape.php +++ b/include/Scrape.php @@ -445,10 +445,19 @@ function probe_url($url, $mode = PROBE_NORMAL) { $adr = imap_rfc822_parse_adrlist($x->to,''); if(isset($adr)) { foreach($adr as $feadr) { - if((strcasecmp($feadr->mailbox,$name) == 0) - &&(strcasecmp($feadr->host,$phost) == 0) + if((strcasecmp($feadr->mailbox,$name) == 0) + &&(strcasecmp($feadr->host,$phost) == 0) && (strlen($feadr->personal))) { - $vcard['fn'] = notags($feadr->personal); + + $personal = imap_mime_header_decode($feadr->personal); + $vcard['fn'] = ""; + foreach($personal as $perspart) + if ($perspart->charset != "default") + $vcard['fn'] .= iconv($perspart->charset, 'UTF-8//IGNORE', $perspart->text); + else + $vcard['fn'] .= $perspart->text; + + $vcard['fn'] = notags($vcard['fn']); } } } |