Merge pull request 'Store answers atomically and limit word cloud input' (#31) from fix/atomic-votes into main
Reviewed-on: #31
This commit was merged in pull request #31.
This commit is contained in:
commit
6912d045cf
11 files changed
+224
-50
No files matched your search
@@ -7,7 +7,6 @@ use App\Captcha\CaptchaFactory;
|
||||
use App\Mailer\PollMailer;
|
||||
use App\Model\Entity\Slide;
|
||||
use App\Model\Table\PollsTable;
|
||||
use App\Service\ThrottleService;
|
||||
use Cake\Core\Configure;
|
||||
use Cake\Http\Response;
|
||||
use Cake\Log\Log;
|
||||
@@ -228,20 +227,6 @@ class HomeController extends AppController
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $bucket Throttle bucket
|
||||
* @param string $configKey Configure key holding the hourly limit
|
||||
* @return bool
|
||||
*/
|
||||
protected function throttle(string $bucket, string $configKey): bool
|
||||
{
|
||||
return (new ThrottleService())->attempt(
|
||||
$bucket,
|
||||
(string)$this->request->clientIp(),
|
||||
(int)Configure::read($configKey, 0),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a mail and logs (instead of throwing) transport errors.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user