소스 검색

Merge pull request #4034 from pixelfed/staging

Update ap inbox
daniel 2 년 전
부모
커밋
a97d2be7b5
1개의 변경된 파일17개의 추가작업 그리고 2개의 파일을 삭제
  1. 17 2
      app/Util/ActivityPub/Inbox.php

+ 17 - 2
app/Util/ActivityPub/Inbox.php

@@ -307,10 +307,20 @@ class Inbox
 	{
 		$activity = $this->payload['object'];
 		$actor = $this->actorFirstOrCreate($this->payload['actor']);
+
+		if(!$actor) {
+			return;
+		}
+
 		$status = Helpers::statusFetch($activity['inReplyTo']);
+
+		if(!$status) {
+			return;
+		}
+
 		$poll = $status->poll;
 
-		if(!$status || !$poll) {
+		if(!$poll) {
 			return;
 		}
 
@@ -486,9 +496,14 @@ class Inbox
 	{
 		$actor = $this->actorFirstOrCreate($this->payload['actor']);
 		$target = $this->actorFirstOrCreate($this->payload['object']);
-		if(!$actor || $actor->domain == null || $target->domain !== null) {
+		if(!$actor || !$target) {
+			return;
+		}
+
+		if($actor->domain == null || $target->domain !== null) {
 			return;
 		}
+
 		if(
 			Follower::whereProfileId($actor->id)
 				->whereFollowingId($target->id)