Remove dead code and validate new polls only once
- Drop the unused polls.show_results_to_participants column (idempotent migration). - Remove CaptchaInterface::getType(), the unused AjaxView with its layout, the empty cell template folder and a redundant setNew() call. - PollsTable::newPoll() normalises and validates once; the create form used to validate the raw input first, so an e-mail address with surrounding spaces was rejected although it would have been trimmed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8b0e82d806
commit
121097f7a7
13 files changed
+78
-102
No files matched your search
@@ -13,11 +13,6 @@ use Cake\Http\ServerRequest;
|
||||
*/
|
||||
interface CaptchaInterface
|
||||
{
|
||||
/**
|
||||
* @return string 'none' | 'math' | 'recaptcha'
|
||||
*/
|
||||
public function getType(): string;
|
||||
|
||||
/**
|
||||
* Prepares a challenge and returns the data the view element needs.
|
||||
*
|
||||
|
||||
@@ -22,14 +22,6 @@ class MathCaptcha implements CaptchaInterface
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getType(): string
|
||||
{
|
||||
return 'math';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
|
||||
@@ -10,14 +10,6 @@ use Cake\Http\ServerRequest;
|
||||
*/
|
||||
class NoCaptcha implements CaptchaInterface
|
||||
{
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getType(): string
|
||||
{
|
||||
return 'none';
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
||||
@@ -34,14 +34,6 @@ class RecaptchaCaptcha implements CaptchaInterface
|
||||
$this->client = $client ?? new Client(['timeout' => 5]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getType(): string
|
||||
{
|
||||
return 'recaptcha';
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user