"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Controller/Component/FormProtectionComponent.php" between
cakephp-4.0.1.tar.gz and cakephp-4.0.2.tar.gz

About: CakePHP is a rapid development framework for PHP applications. Source code.

FormProtectionComponent.php  (cakephp-4.0.1):FormProtectionComponent.php  (cakephp-4.0.2)
skipping to change at line 87 skipping to change at line 87
{ {
$request = $this->getController()->getRequest(); $request = $this->getController()->getRequest();
$data = $request->getParsedBody(); $data = $request->getParsedBody();
$hasData = ($data || $request->is(['put', 'post', 'delete', 'patch'])); $hasData = ($data || $request->is(['put', 'post', 'delete', 'patch']));
if ( if (
!in_array($request->getParam('action'), $this->_config['unlockedActi ons'], true) !in_array($request->getParam('action'), $this->_config['unlockedActi ons'], true)
&& $hasData && $hasData
&& $this->_config['validate'] && $this->_config['validate']
) { ) {
$formProtector = new FormProtector(); $session = $request->getSession();
$request->getSession()->start(); $session->start();
$isValid = $formProtector->validate( $url = Router::url($request->getRequestTarget());
$data,
Router::url($request->getRequestTarget()), $formProtector = new FormProtector($this->_config);
$request->getSession()->id() $isValid = $formProtector->validate($data, $url, $session->id());
);
if (!$isValid) { if (!$isValid) {
return $this->validationFailure($formProtector); return $this->validationFailure($formProtector);
} }
} }
$token = [ $token = [
'unlockedFields' => $this->_config['unlockedFields'], 'unlockedFields' => $this->_config['unlockedFields'],
]; ];
$request = $request->withAttribute('formTokenData', [ $request = $request->withAttribute('formTokenData', [
 End of changes. 1 change blocks. 
7 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)