aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-02-24 20:03:13 -0800
committerfriendica <info@friendica.com>2012-02-24 20:03:13 -0800
commitf5c5da742da1154c26277df7ff86eebea6ffe049 (patch)
treed58a541eb7a0a25a6a0771194b339a16e628f75b /include/items.php
parentb95e3ac496b48e1e515d87a3dfadb46ce0977d3d (diff)
downloadvolse-hubzilla-f5c5da742da1154c26277df7ff86eebea6ffe049.tar.gz
volse-hubzilla-f5c5da742da1154c26277df7ff86eebea6ffe049.tar.bz2
volse-hubzilla-f5c5da742da1154c26277df7ff86eebea6ffe049.zip
attribution issue - don't take author name from contact if available from item.
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php22
1 files changed, 16 insertions, 6 deletions
diff --git a/include/items.php b/include/items.php
index 347826042..ba4ec036f 100755
--- a/include/items.php
+++ b/include/items.php
@@ -1505,13 +1505,18 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
$item_id = $item->get_id();
$datarray = get_atom_elements($feed,$item);
- if(! x($datarray,'author-name'))
+
+ if((! x($datarray,'author-name')) && ($contact['network'] != NETWORK_DFRN))
$datarray['author-name'] = $contact['name'];
- if(! x($datarray,'author-link'))
+ if((! x($datarray,'author-link')) && ($contact['network'] != NETWORK_DFRN))
$datarray['author-link'] = $contact['url'];
- if(! x($datarray,'author-avatar'))
+ if((! x($datarray,'author-avatar')) && ($contact['network'] != NETWORK_DFRN))
$datarray['author-avatar'] = $contact['thumb'];
+ if((! x($datarray,'author-name')) || (! x($datarray,'author-link'))) {
+ logger('consume_feed: no author information! ' . print_r($datarray,true));
+ continue;
+ }
$r = q("SELECT `uid`, `last-child`, `edited`, `body` FROM `item` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
dbesc($item_id),
@@ -1614,14 +1619,19 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
$datarray = get_atom_elements($feed,$item);
if(is_array($contact)) {
- if(! x($datarray,'author-name'))
+ if((! x($datarray,'author-name')) && ($contact['network'] != NETWORK_DFRN))
$datarray['author-name'] = $contact['name'];
- if(! x($datarray,'author-link'))
+ if((! x($datarray,'author-link')) && ($contact['network'] != NETWORK_DFRN))
$datarray['author-link'] = $contact['url'];
- if(! x($datarray,'author-avatar'))
+ if((! x($datarray,'author-avatar')) && ($contact['network'] != NETWORK_DFRN))
$datarray['author-avatar'] = $contact['thumb'];
}
+ if((! x($datarray,'author-name')) || (! x($datarray,'author-link'))) {
+ logger('consume_feed: no author information! ' . print_r($datarray,true));
+ continue;
+ }
+
// special handling for events
if((x($datarray,'object-type')) && ($datarray['object-type'] === ACTIVITY_OBJ_EVENT)) {