*/
public static function getIdByURI(string $uri): int
{
+ if (empty($uri)) {
+ return 0;
+ }
+
// If the URI gets too long we only take the first parts and hope for best
$uri = substr($uri, 0, 255);
* @param string $filename Filename
* @param string $album Album name
* @param integer $scale Scale
- * @param integer $type Photo type
+ * @param integer $type Photo type, optional, default: Photo::DEFAULT
* @param string $allow_cid Permissions, allowed contacts. optional, default = ""
* @param string $allow_gid Permissions, allowed groups. optional, default = ""
* @param string $deny_cid Permissions, denied contacts.optional, default = ""
}
$replyto = JsonLD::fetchElement($activity['as:object'], 'as:inReplyTo', '@id');
- $uriid = ItemURI::getIdByURI($replyto);
+ $uriid = ItemURI::getIdByURI($replyto ?? '');
if (Post::exists(['uri-id' => $uriid])) {
Logger::info('Post is a reply to an existing post - accepted', ['id' => $id, 'uri-id' => $uriid, 'replyto' => $replyto]);
return true;