Hello,
According to the documentation (Security - 3.10)
I try to do the blackhole function but i don’t understand what i should return.
(My final goal is to do a notification and redirect instead of the 4XX error page )
Exemple i have this form
<?= $this->Form->create($statutmembre, ['align' => $_horizontal_form['3-8-1']]) ?><?= $this->Form->hidden('club_id', ['value'=>$_club_id]) ?> <?= $this->Form->input('statutmembres_type_id', ['label'=>'Type de statut','options' => $statutmembresTypes]) ?> <?= $this->Form->input('statut',['label' => __('Nom du statut')]); ?> <?= $this->MyHtml->submit('Enregistrer', 'floppy-o fa-lg', 'text-center','success') ?> <?= $this->Form->end() ?> <?= $this->MyHtml->end_box() ?>
The end of my function blackhole in appController
public function blackhole($type)
{
//…
return false;
}
My before filter is like the exemple in documentation
So when i modify the form with google code inspector for exemple.
If i change the hidden field, the save is still saved.
If i add a field, same thing.
It’s break security component in fact
When i tried to redirect in blackhole function, same thing, security component don’t do the job.
So my question, what i should do in this function to avoid save if the form is not correct ?
Did you have exemple for me ?
Thanks for advance