Apply firewall security on BaseForm::validateForm
modified: core/lib/Thelia/Controller/BaseController.php modified: core/lib/Thelia/Form/AddressCreateForm.php new file: core/lib/Thelia/Form/FirewallForm.php modified: core/lib/Thelia/Model/FormFirewall.php modified: setup/insert.sql
This commit is contained in:
committed by
Benjamin Perche
parent
b42ff568e0
commit
978f15357c
@@ -25,6 +25,7 @@ use Symfony\Component\Routing\Router;
|
||||
|
||||
use Thelia\Core\Template\TemplateHelper;
|
||||
use Thelia\Core\Translation\Translator;
|
||||
use Thelia\Form\FirewallForm;
|
||||
use Thelia\Model\OrderQuery;
|
||||
|
||||
use Thelia\Tools\Redirect;
|
||||
@@ -200,6 +201,14 @@ abstract class BaseController extends ContainerAware
|
||||
$form->bind($aBaseForm->getRequest());
|
||||
|
||||
if ($form->isValid()) {
|
||||
if ($aBaseForm instanceof FirewallForm && !$aBaseForm->isFirewallOk()) {
|
||||
throw new FormValidationException(
|
||||
$this->getTranslator()->trans(
|
||||
"You have too much sent this form. Please wait before trying again."
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return $form;
|
||||
} else {
|
||||
$errorMessage = null;
|
||||
|
||||
Reference in New Issue
Block a user