Commit Graph

49313 Commits

Author SHA1 Message Date
Wouter de Jong
47869887c0 Fix CookieClearingLogoutListener DI configuration 2020-06-15 10:29:02 +02:00
Fabien Potencier
8bb0897a6d bug #37279 [Form] Fixed prototype block prefixes hierarchy of the CollectionType (yceruto)
This PR was merged into the 5.1 branch.

Discussion
----------

[Form] Fixed prototype block prefixes hierarchy of the CollectionType

| Q             | A
| ------------- | ---
| Branch?       | 5.1
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #37024
| License       | MIT
| Doc PR        |

Following https://github.com/symfony/symfony/pull/37276

Commits
-------

65efc36e94 fixed prototype block prefixes hierarchy of the CollectionType
2020-06-15 07:12:47 +02:00
Yonel Ceruto
65efc36e94 fixed prototype block prefixes hierarchy of the CollectionType 2020-06-14 11:52:41 -04:00
Fabien Potencier
ccd9c1fc84 bug #37276 [Form] Fixed block prefixes hierarchy of the CollectionType (yceruto)
This PR was merged into the 5.1 branch.

Discussion
----------

[Form] Fixed block prefixes hierarchy of the CollectionType

| Q             | A
| ------------- | ---
| Branch?       | 5.1
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #37024
| License       | MIT
| Doc PR        | -

/cc @HeahDude

Commits
-------

a8f2c60368 fixed block prefixes hierarchy of the CollectionType
2020-06-14 17:28:54 +02:00
Yonel Ceruto
a8f2c60368 fixed block prefixes hierarchy of the CollectionType 2020-06-14 09:34:09 -04:00
Fabien Potencier
a89cc6bf79 minor #37267 [SecurityBundle] Run functional tests for the authenticator system (wouterj)
This PR was merged into the 5.1 branch.

Discussion
----------

[SecurityBundle] Run functional tests for the authenticator system

| Q             | A
| ------------- | ---
| Branch?       | 5.1
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

<s>Includes https://github.com/symfony/symfony/pull/37261 until it's merged.</s>

This runs all relevant functional tests in the security bundle for both the traditional and the authenticator system. This will hopefully avoid breaking more code in further releases.

deps=high builds will be green once this has been merged up into master.

---

During the functional tests, some inconsistencies were fixed. Three tests revealed larger inconsistencies that couldn't be fixed easily. These are not run for the new system as of now, we need to investigate further how to proceed with them. I'll create a separate issue/discussion for these:

* `Symfony\Bundle\SecurityBundle\Tests\Functional\FirewallEntryPointTest::testItUsesTheConfiguredEntryPointWhenUsingUnknownCredentials`
* `Symfony\Bundle\SecurityBundle\Tests\Functional\CsrfFormLoginTest::testFormLoginWithInvalidCsrfToken`
* `Symfony\Bundle\SecurityBundle\Tests\Functional\SecurityRoutingIntegrationTest::testSecurityConfigurationForExpression`

Commits
-------

49639caeaf [Security] Run functional tests also for the authenticator system
2020-06-13 17:21:48 +02:00
Wouter de Jong
49639caeaf [Security] Run functional tests also for the authenticator system 2020-06-13 17:06:42 +02:00
Fabien Potencier
080eef05b7 bug #37261 Fix register csrf protection listener (Ne-Lexa)
This PR was squashed before being merged into the 5.1 branch.

Discussion
----------

Fix register csrf protection listener

| Q             | A
| ------------- | ---
| Branch?       | 5.1.1
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | np
| Tickets       | #37254
| License       | MIT

Fix TypeError. Expected instance `CsrfTokenManagerInterface`, but `SessionTokenStorage` was given.

```
Uncaught Error: Argument 1 passed to Symfony\Component\Security\Http\EventListener\CsrfProtectionListener::__construct() must implement interface Symfony\Component\Security\Csrf\CsrfTokenManagerInterface, instance of Symfony\Component\Security\Csrf\TokenStorage\SessionTokenStorage given

Uncaught PHP Exception TypeError: "Argument 1 passed to Symfony\Component\Security\Http\EventListener\CsrfProtectionListener::__construct() must implement interface Symfony\Component\Security\Csrf\CsrfTokenManagerInterface, instance of Symfony\Component\Security\Csrf\TokenStorage\SessionTokenStorage given
```

Commits
-------

485361e847 Fix register csrf protection listener
2020-06-13 17:05:39 +02:00
wapplay
485361e847 Fix register csrf protection listener 2020-06-13 17:05:31 +02:00
Fabien Potencier
86c79ce316 bumped Symfony version to 5.1.2 2020-06-12 14:20:44 +02:00
Fabien Potencier
c093c648ae
Merge pull request #37248 from fabpot/release-5.1.1
released v5.1.1
2020-06-12 13:26:14 +02:00
Fabien Potencier
6aafc48ddf updated VERSION for 5.1.1 2020-06-12 13:25:56 +02:00
Fabien Potencier
5ad89d13b6 updated CHANGELOG for 5.1.1 2020-06-12 13:25:49 +02:00
Nicolas Grekas
3afa4b2e72 Merge branch '5.0' into 5.1
* 5.0:
  cs
  fix merge
2020-06-12 10:39:51 +02:00
Nicolas Grekas
7b6ffda0b9 cs 2020-06-12 10:39:40 +02:00
Nicolas Grekas
d735b76302 fix merge 2020-06-12 10:38:59 +02:00
Nicolas Grekas
acc88829de Merge branch '5.0' into 5.1
* 5.0:
  fix merge
2020-06-12 10:26:18 +02:00
Nicolas Grekas
15747d3ebb Merge branch '4.4' into 5.0
* 4.4:
  fix merge
2020-06-12 10:26:05 +02:00
Nicolas Grekas
6304b6b11a fix merge 2020-06-12 10:25:05 +02:00
Nicolas Grekas
5b70cc8ac8 Merge branch '5.0' into 5.1
* 5.0:
  fix merge
2020-06-12 10:22:42 +02:00
Nicolas Grekas
8fa1cea06d fix merge 2020-06-12 10:22:28 +02:00
Nicolas Grekas
03bd1bf90a Merge branch '5.0' into 5.1
* 5.0:
  [DependencyInjection][CheckTypeDeclarationsPass] Handle unresolved parameters pointing to environment variables
  switch the context when validating nested forms
  remove unused param from validator service config
  Fix typo
  [HttpKernel] Fix regression where Store does not return response body correctly
  rework form validator tests
  Update AbstractController.php
2020-06-12 10:11:32 +02:00
Nicolas Grekas
6c4695f4ec Merge branch '4.4' into 5.0
* 4.4:
  [DependencyInjection][CheckTypeDeclarationsPass] Handle unresolved parameters pointing to environment variables
  switch the context when validating nested forms
  remove unused param from validator service config
  Fix typo
  [HttpKernel] Fix regression where Store does not return response body correctly
  rework form validator tests
  Update AbstractController.php
2020-06-12 10:11:14 +02:00
Nicolas Grekas
02df1c9b53 Merge branch '3.4' into 4.4
* 3.4:
  switch the context when validating nested forms
  Fix typo
  [HttpKernel] Fix regression where Store does not return response body correctly
  rework form validator tests
  Update AbstractController.php
2020-06-12 10:10:13 +02:00
Fabien Potencier
fd51aeb20b bug #37227 [DependencyInjection][CheckTypeDeclarationsPass] Handle unresolved parameters pointing to environment variables (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection][CheckTypeDeclarationsPass] Handle unresolved parameters pointing to environment variables

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Follow up to https://github.com/symfony/symfony/pull/37193

Unresolved parameters pointing to environment variables can be added to definitions after ResolveParameterPlaceHoldersPass execution. It is the case in the initial reported bug (RegisterListenersPass is executed after ResolveParameterPlaceHoldersPass). In this case, the parameter value is an env placeholder, so we need to try to resolve it.

Commits
-------

dac3c8fae8 [DependencyInjection][CheckTypeDeclarationsPass] Handle unresolved parameters pointing to environment variables
2020-06-12 10:01:48 +02:00
Thomas Calvet
dac3c8fae8 [DependencyInjection][CheckTypeDeclarationsPass] Handle unresolved parameters pointing to environment variables 2020-06-12 09:37:04 +02:00
Fabien Potencier
1f83212541 bug #37103 [Form] switch the context when validating nested forms (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] switch the context when validating nested forms

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #37072
| License       | MIT
| Doc PR        |

Commits
-------

38135de549 switch the context when validating nested forms
2020-06-12 09:33:15 +02:00
Christian Flothmann
38135de549 switch the context when validating nested forms 2020-06-12 09:11:17 +02:00
Fabien Potencier
f1989fe41c minor #37236 remove unused param from validator service config (Tobion)
This PR was merged into the 4.4 branch.

Discussion
----------

remove unused param from validator service config

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       |
| License       | MIT
| Doc PR        |

Commits
-------

d75ec21cdb remove unused param from validator service config
2020-06-12 08:06:18 +02:00
Tobias Schultze
d75ec21cdb remove unused param from validator service config 2020-06-12 02:09:24 +02:00
Tobias Schultze
bb80fbf931 Merge branch '5.0' into 5.1 2020-06-11 23:53:51 +02:00
Tobias Schultze
00bf63d9fd Merge branch '4.4' into 5.0 2020-06-11 23:53:02 +02:00
Tobias Schultze
2d781ddce6 fix test checking non-existing arg 2020-06-11 23:52:31 +02:00
Tobias Schultze
551f7cfa8d Merge branch '5.0' into 5.1 2020-06-11 23:20:02 +02:00
Tobias Schultze
c704acbf9b Merge branch '4.4' into 5.0 2020-06-11 23:19:34 +02:00
Fabien Potencier
51be09c13c minor #37214 Remove non-existing arg and param from serializer service config (Tobion)
This PR was merged into the 4.4 branch.

Discussion
----------

Remove non-existing arg and param from serializer service config

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       |
| License       | MIT
| Doc PR        |

Leftover from #22741

Commits
-------

d179d71f45 Remove non-existing arg and param from serializer service config
2020-06-11 16:32:27 +02:00
Fabien Potencier
816b6ea6f1 Fix typo 2020-06-11 15:00:25 +02:00
Fabien Potencier
54c9054ef4 bug #37182 [HttpKernel] Fix regression where Store does not return response body correctly (mpdude)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[HttpKernel] Fix regression where Store does not return response body correctly

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #37174
| License       | MIT
| Doc PR        |

Since #36833, the `Store` no longer uses or trusts the `X-Content-Digest` header present on a response, since that may come (in the case of using `CachingHttpClient`) from upstream HTTP sources. Instead, the `X-Content-Digest` is re-computed every time a response is written by the `Store`.

Additionally, the `Store` is implemented in a way that when restoring responses, it does _not_ actually load the response body, but just keeps the file path to the content on disk in another internal header called `X-Body-File`. It is up to others (`HttpCache`, for example) to actually load the content from there. For reasons I could not determine, the file path is also set as the response body.

When the `HttpCache` performs revalidations, it may happen that it wants the `Store` to persist a previously restored response. In that case, the `Store` fails to honor its own `X-Body-File` header. Instead, it would compute (since #36833) the `X-Content-Digest`, which now is a hash of the cache file path.

So, we end up with a response that still carries `X-Body-File` for the original, correct response. Since the `HttpCache` honors this value, we don't immediately notice that. But inside the `Store`, the request is now associated with the _new_ (bogus) content entry.

It takes another round of looking up the content in the `Store` to now get a response where the `X-Body-File` _also_ points to the wrong content entry.

Although I feel a bit uncomfortable with trusting headers that seemingly need to be evaluated in different classes and may come from elsewhere, my suggestion is to skip the write inside `Store` if `X-Body-File` and `X-Content-Digest` are both present and consistent with each other.

Additionally, a `file_exists` check could be added to provide additional assertions, at the cost of accessing the filesystem.

Commits
-------

176e769e5f [HttpKernel] Fix regression where Store does not return response body correctly
2020-06-11 14:59:43 +02:00
Matthias Pigulla
176e769e5f [HttpKernel] Fix regression where Store does not return response body correctly 2020-06-11 14:59:37 +02:00
Fabien Potencier
b1f2a1409c bug #37193 [DependencyInjection][CheckTypeDeclarationsPass] Always resolve parameters (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection][CheckTypeDeclarationsPass] Always resolve parameters

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/37166
| License       | MIT
| Doc PR        | -

> Only array parameters are not inlined when dumped.

This is true only when the XML debug container is used, not on a live container that can contain unresolved parameters in the `%my_param%` form. That was my mistake. We have to resolve to get the parameter type.

`$value = [];` was just an improvement to avoid useless parameter resolve btw.

Commits
-------

da0e2c36ef [DependencyInjection][CheckTypeDeclarationsPass] Always resolve parameters
2020-06-11 14:58:51 +02:00
Fabien Potencier
faafec4a04 bug #37044 [DependencyInjection] Apply ExpressionLanguageProviderPass to router.default (wizhippo)
This PR was squashed before being merged into the 5.1 branch.

Discussion
----------

[DependencyInjection] Apply ExpressionLanguageProviderPass to router.default

| Q             | A
| ------------- | ---
| Branch?       |  5.1
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix https://github.com/symfony/symfony/issues/37042
| License       | MIT

Using a `chain_router` usually replaces the `router` and add the `router.default` to it's chain.

This would `addExpressionLanguageProvider` to the default router only as the chain router is not expected to have `addExpressionLanguageProvider` as it is not part of the router interface.

Commits
-------

215ad1f93d [DependencyInjection] Apply ExpressionLanguageProviderPass to router.default
2020-06-11 14:57:51 +02:00
Douglas Hammond
215ad1f93d [DependencyInjection] Apply ExpressionLanguageProviderPass to router.default 2020-06-11 14:57:45 +02:00
Tobias Schultze
d179d71f45 Remove non-existing arg and param from serializer service config 2020-06-11 14:32:28 +02:00
Nicolas Grekas
69c37c0335 bug #37054 [String] Fix ellipsis of truncate when not using cut option (DuboisS)
This PR was merged into the 5.1 branch.

Discussion
----------

[String] Fix ellipsis of truncate when not using cut option

| Q             | A
| ------------- | ---
| Branch?       | 5.1 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | - <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | - <!-- required for new features -->

[Since 5.1](https://symfony.com/blog/new-in-symfony-5-1-string-improvements#keep-the-last-word-when-truncating), we can use a cut option on truncate.
But with this option, we don't have the expected behavior when the entire chain is returned.

Currently:
`u('Lorem Ipsum')->truncate(8, '…', false); // 'Lorem Ipsum...'`
Instead of:
`u('Lorem Ipsum')->truncate(8, '…', false); // 'Lorem Ipsum'`

Thanks to @jmsche for his help.

Commits
-------

a2ee6c6cf4 [String] Fix ellipsis of truncate when not using cut option
2020-06-11 14:17:23 +02:00
Steven Dubois
a2ee6c6cf4 [String] Fix ellipsis of truncate when not using cut option 2020-06-11 14:16:36 +02:00
Fabien Potencier
816958176c bug #37190 [HttpClient] disable AMP's inactivity timeout, we deal with it on our own already (nicolas-grekas)
This PR was merged into the 5.1 branch.

Discussion
----------

[HttpClient] disable AMP's inactivity timeout, we deal with it on our own already

| Q             | A
| ------------- | ---
| Branch?       | 5.1
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36911
| License       | MIT
| Doc PR        | -

I encountered this today also.

Commits
-------

a7b18ff590 [HttpClient] disable AMP's inactivity timeout, we deal with it on our own already
2020-06-11 08:14:20 +02:00
Fabien Potencier
7107080675 bug #37191 [HttpClient] fix offset computation for data chunks (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] fix offset computation for data chunks

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

A minor thingy, still a bugfix.

Commits
-------

ff05be06ec [HttpClient] fix offset computation for data chunks
2020-06-11 08:13:02 +02:00
Thomas Calvet
da0e2c36ef [DependencyInjection][CheckTypeDeclarationsPass] Always resolve parameters 2020-06-10 18:12:11 +02:00
Nicolas Grekas
ff05be06ec [HttpClient] fix offset computation for data chunks 2020-06-10 17:33:47 +02:00
Nicolas Grekas
a7b18ff590 [HttpClient] disable AMP's inactivity timeout, we deal with it on our own already 2020-06-10 17:30:04 +02:00