Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ea52400

Browse filesBrowse files
Trent SteelTobion
Trent Steel
authored andcommitted
remove unnecessary retrieval and setting of data
1 parent 730a472 commit ea52400
Copy full SHA for ea52400

File tree

Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed

‎src/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,10 @@ public function __construct($fieldName, CsrfProviderInterface $csrfProvider, $in
8484
public function preSubmit(FormEvent $event)
8585
{
8686
$form = $event->getForm();
87-
$data = $event->getData();
8887

8988
if ($form->isRoot() && $form->getConfig()->getOption('compound')) {
89+
$data = $event->getData();
90+
9091
if (!isset($data[$this->fieldName]) || !$this->csrfProvider->isCsrfTokenValid($this->intention, $data[$this->fieldName])) {
9192
$errorMessage = $this->errorMessage;
9293

@@ -99,10 +100,9 @@ public function preSubmit(FormEvent $event)
99100

100101
if (is_array($data)) {
101102
unset($data[$this->fieldName]);
103+
$event->setData($data);
102104
}
103105
}
104-
105-
$event->setData($data);
106106
}
107107

108108
/**

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.