From c44d692aa4f44c6ac824e85d07402a992fe138d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Menrath?= Date: Wed, 11 Dec 2024 23:32:19 +0100 Subject: [PATCH] fix --- includes/class-event-sources.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/class-event-sources.php b/includes/class-event-sources.php index ee10388..fe57ad9 100644 --- a/includes/class-event-sources.php +++ b/includes/class-event-sources.php @@ -13,6 +13,7 @@ use Activitypub\Activity\Extended_Object\Event; use Activitypub\Collection\Actors; use function Activitypub\get_remote_metadata_by_actor; +use function Activitypub\is_activitypub_request; /** * Class for handling and saving the ActivityPub event sources (i.e. follows). @@ -135,6 +136,10 @@ class Event_Sources { return $template; } + if ( ! is_activitypub_request() ) { + return $template; + } + if ( ! \is_singular() ) { return $template; } @@ -146,7 +151,8 @@ class Event_Sources { } if ( ! str_starts_with( \get_site_url(), $post->guid ) ) { - \wp_safe_redirect( $post->guid, 301 ); + \wp_redirect( $post->guid, 301 ); + exit; } return $template;