Explorar el Código

Merge pull request #3366 from pixelfed/staging

Update AP helpers
daniel hace 3 años
padre
commit
16e58ccbd8
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. 6 1
      app/Util/ActivityPub/Helpers.php

+ 6 - 1
app/Util/ActivityPub/Helpers.php

@@ -457,9 +457,14 @@ class Helpers {
 			$ts = self::pluckval($activity['published']);
 			$scope = self::getScope($activity);
 			$cw = self::getSensitive($activity);
+			$pid = is_object($profile) ? $profile->id : (is_array($profile) ? $profile['id'] : null);
+
+			if(!$pid) {
+				return;
+			}
 
 			$status = new Status;
-			$status->profile_id = $profile->id;
+			$status->profile_id = $pid;
 			$status->url = $url;
 			$status->uri = $url;
 			$status->object_url = $id;