Fix fatal execution path for found Network::get() parameter execption

This commit is contained in:
nupplaPhil 2020-03-07 13:39:09 +01:00 committed by Hypolite Petovan
parent c51128ad20
commit 1998b7811b
3 changed files with 6 additions and 6 deletions

View file

@ -3639,7 +3639,7 @@ class Item
*
* @return integer item id
*/
public static function fetchByLink($uri, $uid = 0)
public static function fetchByLink(string $uri, int $uid = 0)
{
$item_id = self::searchByLink($uri, $uid);
if (!empty($item_id)) {
@ -3692,7 +3692,7 @@ class Item
*
* @return array item array with data from the original item
*/
public static function addShareDataFromOriginal($item)
public static function addShareDataFromOriginal(array $item)
{
$shared = self::getShareArray($item);
if (empty($shared)) {
@ -3714,9 +3714,9 @@ class Item
}
// Otherwhise try to find (and possibly fetch) the item via the link. This should work for Diaspora and ActivityPub posts
$id = self::fetchByLink($shared['link'], $uid);
$id = self::fetchByLink($shared['link'] ?? '', $uid);
if (empty($id)) {
Logger::info('Original item not found', ['url' => $shared['link'], 'callstack' => System::callstack()]);
Logger::info('Original item not found', ['url' => $shared['link'] ?? '', 'callstack' => System::callstack()]);
return $item;
}