From 69df67740cf01e5a82db6033c7c5b5f3f22b0671 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 1 Jan 2018 17:12:40 -0500 Subject: [PATCH] Last minute fix to include/items - Use defaults() to fix undefined indexes --- include/items.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/items.php b/include/items.php index 9bb5ceb79..02f21d492 100644 --- a/include/items.php +++ b/include/items.php @@ -421,7 +421,7 @@ function uri_to_guid($uri, $host = "") { * @return array Item array with removed conversation data */ function store_conversation($arr) { - if (in_array($arr['network'], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS)) && !empty($arr['uri'])) { + if (in_array(defaults($arr, 'network', NETWORK_PHANTOM), array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS)) && !empty($arr['uri'])) { $conversation = array('item-uri' => $arr['uri'], 'received' => DBM::date()); if (isset($arr['parent-uri']) && ($arr['parent-uri'] != $arr['uri'])) { @@ -535,7 +535,7 @@ function item_store($arr, $force_parent = false, $notify = false, $dontcache = f // Converting the plink /// @todo Check if this is really still needed - if ($arr['network'] == NETWORK_OSTATUS) { + if (defaults($arr, 'network', NETWORK_PHANTOM) == NETWORK_OSTATUS) { if (isset($arr['plink'])) { $arr['plink'] = OStatus::convertHref($arr['plink']); } elseif (isset($arr['uri'])) { @@ -581,7 +581,7 @@ function item_store($arr, $force_parent = false, $notify = false, $dontcache = f * We have to check several networks since Friendica posts could be repeated * via OStatus (maybe Diasporsa as well) */ - if (in_array(trim($arr['network']), array(NETWORK_DIASPORA, NETWORK_DFRN, NETWORK_OSTATUS, ""))) { + if (in_array(trim(defaults($arr, 'network', NETWORK_PHANTOM)), array(NETWORK_DIASPORA, NETWORK_DFRN, NETWORK_OSTATUS, ""))) { $r = q("SELECT `id`, `network` FROM `item` WHERE `uri` = '%s' AND `uid` = %d AND `network` IN ('%s', '%s', '%s') LIMIT 1", dbesc(trim($arr['uri'])), intval($uid),