From cca1fd23dc9bdfd85c4d749386a800942690987c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ca=C5=82ka?= Date: Fri, 16 Jun 2023 16:26:55 +0200 Subject: [PATCH] fix(fof/masquerade): Use the user ID instead of an actor that can be a moderator --- src/Compatibility/FofMasquerade/Middleware.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Compatibility/FofMasquerade/Middleware.php b/src/Compatibility/FofMasquerade/Middleware.php index 8d4ec0f..eb42b40 100644 --- a/src/Compatibility/FofMasquerade/Middleware.php +++ b/src/Compatibility/FofMasquerade/Middleware.php @@ -4,6 +4,7 @@ use ACPL\FlarumCache\Abstract\PurgeMiddleware; use Flarum\Http\RequestUtil; +use Flarum\User\User; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; @@ -17,7 +18,8 @@ protected function processPurge( ): ResponseInterface { // Purge user profile cache when updating FriendsOfFlarum/masquerade fields if ($this->currentRouteName === 'masquerade.api.configure.save') { - $user = RequestUtil::getActor($request); + $userID = $this->getRouteParams($request)['id']; + $user = User::find($userID); return $this->addPurgeParamsToResponse( $response,