1
0
mirror of https://github.com/flarum/core.git synced 2025-10-18 18:26:07 +02:00

Move floodgate to middleware, add extender + integration tests (#2170)

This commit is contained in:
Alexander Skvortsov
2020-11-29 17:13:22 -05:00
committed by GitHub
parent 387b4fd315
commit 1a5e4d454e
14 changed files with 400 additions and 2 deletions

View File

@@ -64,6 +64,9 @@ class CreateDiscussionController extends AbstractCreateController
$actor = $request->getAttribute('actor');
$ipAddress = Arr::get($request->getServerParams(), 'REMOTE_ADDR', '127.0.0.1');
/**
* @deprecated, remove in beta 15.
*/
if (! $request->getAttribute('bypassFloodgate')) {
$this->floodgate->assertNotFlooding($actor);
}

View File

@@ -65,6 +65,9 @@ class CreatePostController extends AbstractCreateController
$discussionId = Arr::get($data, 'relationships.discussion.data.id');
$ipAddress = Arr::get($request->getServerParams(), 'REMOTE_ADDR', '127.0.0.1');
/**
* @deprecated, remove in beta 15.
*/
if (! $request->getAttribute('bypassFloodgate')) {
$this->floodgate->assertNotFlooding($actor);
}