Merge pull request #4502 from annando/guid-from-mail

guid creation: Take the hostname from mail addresses for mail posts
This commit is contained in:
Hypolite Petovan 2018-02-26 09:36:56 -05:00 committed by GitHub
commit 2b9561a774
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -260,6 +260,12 @@ class Item extends BaseObject
$prefix_host = $parsed['host']; $prefix_host = $parsed['host'];
} }
} }
// Is it in the format data@host.tld? - Used for mail contacts
if (empty($prefix_host) && !empty($item['author-link']) && strstr($item['author-link'], '@')) {
$mailparts = explode('@', $item['author-link']);
$prefix_host = array_pop($mailparts);
}
} }
if (!empty($item['plink'])) { if (!empty($item['plink'])) {