Use default value for uid parameter in Contact::getIdForURL

This commit is contained in:
Hypolite Petovan 2018-03-01 19:53:47 -05:00
parent 01c7945b7a
commit 9f21e7f34f
5 changed files with 10 additions and 10 deletions

View file

@ -162,8 +162,8 @@ class PostUpdate
// Set the "author-id" and "owner-id" in the item table and add a new public contact entry if needed
foreach ($item_arr as $item) {
$author_id = Contact::getIdForURL($item["author-link"], 0);
$owner_id = Contact::getIdForURL($item["owner-link"], 0);
$author_id = Contact::getIdForURL($item["author-link"]);
$owner_id = Contact::getIdForURL($item["owner-link"]);
if ($author_id == 0)
$author_id = -1;

View file

@ -474,14 +474,14 @@ class Item extends BaseObject
// The contact-id should be set before "self::insert" was called - but there seems to be issues sometimes
$item["contact-id"] = self::contactId($item);
$item['author-id'] = defaults($item, 'author-id', Contact::getIdForURL($item["author-link"], 0));
$item['author-id'] = defaults($item, 'author-id', Contact::getIdForURL($item["author-link"]));
if (Contact::isBlocked($item["author-id"])) {
logger('Contact '.$item["author-id"].' is blocked, item '.$item["uri"].' will not be stored');
return 0;
}
$item['owner-id'] = defaults($item, 'owner-id', Contact::getIdForURL($item["owner-link"], 0));
$item['owner-id'] = defaults($item, 'owner-id', Contact::getIdForURL($item["owner-link"]));
if (Contact::isBlocked($item["owner-id"])) {
logger('Contact '.$item["owner-id"].' is blocked, item '.$item["uri"].' will not be stored');
@ -897,7 +897,7 @@ class Item extends BaseObject
$item['uid'] = 0;
$item['origin'] = 0;
$item['wall'] = 0;
$item['contact-id'] = Contact::getIdForURL($item['author-link'], 0);
$item['contact-id'] = Contact::getIdForURL($item['author-link']);
if (in_array($item['type'], ["net-comment", "wall-comment"])) {
$item['type'] = 'remote-comment';
@ -951,7 +951,7 @@ class Item extends BaseObject
$item['uid'] = 0;
$item['origin'] = 0;
$item['wall'] = 0;
$item['contact-id'] = Contact::getIdForURL($item['author-link'], 0);
$item['contact-id'] = Contact::getIdForURL($item['author-link']);
if (in_array($item['type'], ["net-comment", "wall-comment"])) {
$item['type'] = 'remote-comment';