aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/Scrape.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/Scrape.php b/include/Scrape.php
index b80f24c22..58468a40d 100644
--- a/include/Scrape.php
+++ b/include/Scrape.php
@@ -430,7 +430,8 @@ function probe_url($url, $mode = PROBE_NORMAL) {
$addr = $orig_url;
$network = NETWORK_MAIL;
$name = substr($url,0,strpos($url,'@'));
- $profile = 'http://' . substr($url,strpos($url,'@')+1);
+ $phost = substr($url,strpos($url,'@')+1);
+ $profile = 'http://' . $phost;
// fix nick character range
$vcard = array('fn' => $name, 'nick' => $name, 'photo' => gravatar_img($url));
$notify = 'smtp ' . random_string();
@@ -441,8 +442,15 @@ function probe_url($url, $mode = PROBE_NORMAL) {
$adr = imap_rfc822_parse_adrlist($x->from,'');
elseif(stristr($x->to,$orig_url))
$adr = imap_rfc822_parse_adrlist($x->to,'');
- if(isset($adr) && strlen($adr[0]->personal))
- $vcard['fn'] = notags($adr[0]->personal);
+ if(isset($adr)) {
+ foreach($adr as $feadr) {
+ if((strcasecmp($feadr->mailbox,$name) == 0)
+ &&(strcasecmp($feadr->host,$phost) == 0)
+ && (strlen($feadr->personal))) {
+ $vcard['fn'] = notags($feadr->personal);
+ }
+ }
+ }
}
imap_close($mbox);
}