From 9e721c09085287fe5d5ca7382b4ec2aa6c17348c Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 26 Feb 2018 11:48:05 +0000 Subject: [PATCH] guid creation: Take the hostname from mail addresses for mail posts --- src/Model/Item.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Model/Item.php b/src/Model/Item.php index 8747f9fee3..696860e16c 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -260,6 +260,12 @@ class Item extends BaseObject $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'])) {