Commit Graph

49035 Commits

Author SHA1 Message Date
Nicolas Grekas
819f76a11f Merge branch '5.0' into 5.1
* 5.0:
  [PhpUnitBridge] fix installing on PHP 8 (ter)
  [PhpUnitBridge] fix installing on PHP 8 (bis)
  [PhpUnitBridge] fix installing on PHP 8
2020-05-21 00:11:07 +02:00
Nicolas Grekas
f280829ad8 Merge branch '4.4' into 5.0
* 4.4:
  [PhpUnitBridge] fix installing on PHP 8 (ter)
  [PhpUnitBridge] fix installing on PHP 8 (bis)
  [PhpUnitBridge] fix installing on PHP 8
2020-05-21 00:10:58 +02:00
Nicolas Grekas
ef6a85b7ea Merge branch '3.4' into 4.4
* 3.4:
  [PhpUnitBridge] fix installing on PHP 8 (ter)
  [PhpUnitBridge] fix installing on PHP 8 (bis)
2020-05-21 00:10:46 +02:00
Nicolas Grekas
5ec5bfb23c [PhpUnitBridge] fix installing on PHP 8 (ter) 2020-05-21 00:09:52 +02:00
Nicolas Grekas
c101259192 [PhpUnitBridge] fix installing on PHP 8 (bis) 2020-05-20 23:58:15 +02:00
Nicolas Grekas
a6ea1da1e6 Merge branch '3.4' into 4.4
* 3.4:
  [PhpUnitBridge] fix installing on PHP 8
2020-05-20 23:50:56 +02:00
Nicolas Grekas
606715b6ec [PhpUnitBridge] fix installing on PHP 8 2020-05-20 23:49:59 +02:00
Nicolas Grekas
e65cdb685f Merge branch '5.0' into 5.1
* 5.0:
  [PhpUnitBridge] fix leftover
  [PhpUnitBridge] fix installing under PHP >= 8
  Use ">=" for the "php" requirement
  bump icu 67.1
2020-05-20 19:43:50 +02:00
Nicolas Grekas
b429b15eb5 Merge branch '4.4' into 5.0
* 4.4:
  [PhpUnitBridge] fix leftover
  [PhpUnitBridge] fix installing under PHP >= 8
  Use ">=" for the "php" requirement
  bump icu 67.1
2020-05-20 19:38:26 +02:00
Nicolas Grekas
53d89f71d6 Merge branch '3.4' into 4.4
* 3.4:
  [PhpUnitBridge] fix leftover
  [PhpUnitBridge] fix installing under PHP >= 8
2020-05-20 19:31:34 +02:00
Nicolas Grekas
b6151ed6cc [PhpUnitBridge] fix leftover 2020-05-20 19:29:51 +02:00
Fabien Potencier
0438baa22f bug #36882 [PhpUnitBridge] fix installing under PHP >= 8 (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[PhpUnitBridge] fix installing under PHP >= 8

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

[As experimented on Twig](b952011f95), using `simple-phpunit` is not simple enough when testing with PHP 8.

This PR fixes the issue so that we could remove these lines in Twig.

On 3.4 since supporting new versions of PHP is a bugfix according to our policies.

Commits
-------

5aa25ceb41 [PhpUnitBridge] fix installing under PHP >= 8
2020-05-20 19:21:57 +02:00
Nicolas Grekas
5aa25ceb41 [PhpUnitBridge] fix installing under PHP >= 8 2020-05-20 18:13:38 +02:00
Fabien Potencier
8f6afdd9d5 minor #36876 Use ">=" for the "php" requirement (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

Use ">=" for the "php" requirement

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

As explained in https://twitter.com/nicolasgrekas/status/1263023258938548225:

Using `"^7.x"` is our composer.json has been a mistake. We should always use `">=7.x"`! 3 reasons:
1. it's either planned obsolescence xor a strong promise to maintain in the long run. None is sustainable.
2. if you actually end up maintaining in the long run (not by promise but by fact), your latest versions will work with PHP 8 by definition.
3. meanwhile, `"^7.x"` prevented all your ecosystem from experimenting with PHP 8, which means they increased the workload on *you* the core maintainer.

Conclusion: always use `">="` for the `"php"` requirement. Hope for the best (it mostly happens) and enable your community to experiment with the next major asap without adding useless impediments.

Commits
-------

f8aa0873cf Use ">=" for the "php" requirement
2020-05-20 11:06:03 +02:00
Nicolas Grekas
f8aa0873cf Use ">=" for the "php" requirement 2020-05-20 10:37:50 +02:00
Nicolas Grekas
17b0597d3e minor #36875 [Intl] bump icu 67.1 (ro0NL)
This PR was merged into the 4.4 branch.

Discussion
----------

[Intl] bump icu 67.1

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/releases):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too.)
 - Features and deprecations must be submitted against branch master.
-->

Commits
-------

920e319051 bump icu 67.1
2020-05-19 19:44:17 +02:00
Roland Franssen
920e319051 bump icu 67.1 2020-05-19 19:12:53 +02:00
Nicolas Grekas
0fd5b95178 bug #36859 [Validator] allow passing a validator to Validation::createCallable() (nicolas-grekas)
This PR was merged into the 5.1 branch.

Discussion
----------

[Validator] allow passing a validator to Validation::createCallable()

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

As spotted by @stof in https://github.com/symfony/symfony/pull/31466#issuecomment-630054227

Commits
-------

1357cbf8ed [Validator] allow passing a validator to Validation::createCallable()
2020-05-19 19:03:49 +02:00
Nicolas Grekas
754bba483e minor #36866 [DI][Preload] Remove preload primitive types (Michał Jusięga, michaljusiega)
This PR was merged into the 5.1 branch.

Discussion
----------

[DI][Preload] Remove preload primitive types

| Q             | A
| ------------- | ---
| Branch?       | 5.1
| Bug fix?      | no, but it could be for the future
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

After bump my project to  5.1.x-dev I saw the generated file of `*.preload.php` contains classes that are primitive types like int, string, bool.

```
composer create-project symfony/website-skeleton preload "5.1.x-dev"
cat preload/var/cache/dev/App_KernelDevDebugContainer.preload.php | grep "bool\|string\|int"
```

```
$ cat test/var/cache/dev/App_KernelDevDebugContainer.preload.php | grep "bool\|string\|int"
$classes[] = 'int';
$classes[] = 'string';
$classes[] = 'Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntityValidator';
$classes[] = 'Symfony\Component\Security\Http\EntryPoint\RetryAuthenticationEntryPoint';
$classes[] = 'Symfony\Component\Security\Core\Validator\Constraints\UserPasswordValidator';
$classes[] = 'Symfony\Component\Serializer\Normalizer\ConstraintViolationListNormalizer';
$classes[] = 'bool';
$classes[] = 'Symfony\Component\Validator\ContainerConstraintValidatorFactory';
$classes[] = 'Symfony\Component\Validator\Constraints\EmailValidator';
$classes[] = 'Symfony\Component\Validator\Constraints\ExpressionValidator';
$classes[] = 'Symfony\Component\Validator\Constraints\NotCompromisedPasswordValidator';
$classes[] = 'Symfony\\Component\\Form\\Extension\\Validator\\Constraints\\Form';
```

I don't know if it is expected behaviour, but if not - then PR fix it.

~~In addition, classes are sorted for better reading.~~

Commits
-------

4d05dbbfb5 [DI] Remove preload primitive types
2020-05-19 19:02:44 +02:00
Michał Jusięga
4d05dbbfb5 [DI] Remove preload primitive types 2020-05-19 19:02:10 +02:00
Nicolas Grekas
b7ecb1582a Merge branch '5.0' into 5.1
* 5.0:
  [Validator] Add missing translations of nn locale
  [HttpKernel] Fix that the `Store` would not save responses with the X-Content-Digest header present
  [Intl] bump icu 67.1
2020-05-19 18:57:22 +02:00
Nicolas Grekas
6237e3d569 Merge branch '4.4' into 5.0
* 4.4:
  [Validator] Add missing translations of nn locale
  [HttpKernel] Fix that the `Store` would not save responses with the X-Content-Digest header present
  [Intl] bump icu 67.1
2020-05-19 18:57:09 +02:00
Nicolas Grekas
2c57ae2b97 Merge branch '3.4' into 4.4
* 3.4:
  [Validator] Add missing translations of nn locale
  [HttpKernel] Fix that the `Store` would not save responses with the X-Content-Digest header present
  [Intl] bump icu 67.1
2020-05-19 18:54:45 +02:00
Nicolas Grekas
5fc4d1b645 minor #36863 [Validator] Add missing translations of nn locale (themilanfan)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Validator] Add missing translations of nn locale

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes/no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #30178
| License       | MIT

Added missing translations to validator with locale nn

Commits
-------

040d01e53b [Validator] Add missing translations of nn locale
2020-05-19 18:38:52 +02:00
Giuseppe Campanelli
040d01e53b [Validator] Add missing translations of nn locale 2020-05-19 18:38:46 +02:00
Nicolas Grekas
af0df4ce14 bug #36833 [HttpKernel] Fix that the Store would not save responses with the X-Content-Digest header present (mpdude)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[HttpKernel] Fix that the `Store` would not save responses with the X-Content-Digest header present

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

Responses fetched from upstream sources might have a `X-Content-Digest` header, for example if the Symfony Cache is used upstream. This currently prevents the `Store` from saving such responses. In general, the value of this header should not be trusted.

As I consider this header an implementation detail of the `Store`, the fix tries to be local to that class; we should not rely on the `HttpCache` or other classes to remove untrustworthy headers for us.

This fixes the issue that when using the `HttpCache` in combination with the Symfony HttpClient, responses that have also been cached upstream in an instance of `HttpCache` are not cached locally. It adds the overhead of re-computing the content digest every time the `HttpCache` successfully re-validated a response.

Commits
-------

d8964fb8b7 [HttpKernel] Fix that the `Store` would not save responses with the X-Content-Digest header present
2020-05-19 18:37:57 +02:00
Matthias Pigulla
d8964fb8b7 [HttpKernel] Fix that the Store would not save responses with the X-Content-Digest header present 2020-05-19 18:37:51 +02:00
Nicolas Grekas
42c79753eb minor #36860 [Intl] bump icu 67.1 (ro0NL)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Intl] bump icu 67.1

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

mainly some new locales+scripts (see 3a3a9ba)

Commits
-------

29eb271184 [Intl] bump icu 67.1
2020-05-19 18:34:53 +02:00
Roland Franssen
29eb271184 [Intl] bump icu 67.1 2020-05-19 18:34:45 +02:00
Anton Kroshilin
fb1967210e [Messenger] Fixed check for allowed options in AwsSqs configuration
Before this fix it was unavailable to create Connection with access_key and secret_key in options, because they were added to $clientConfiguration var, and check for extra options was against $configuration var. Which lead to exception.
The idea is to check input options against self::DEFAULT_OPTIONS (which contains all available options)
2020-05-19 17:36:26 +03:00
Nicolas Grekas
b92399136e Merge branch '5.0' into 5.1
* 5.0:
  [PhpUnitBridge] fix bad detection of unsilenced deprecations
  [Security] Unserialize $parentData, if needed, to avoid errors
  [HttpKernel] Fix error logger when stderr is redirected to /dev/null (FPM)
2020-05-19 10:31:21 +02:00
Nicolas Grekas
31ffd761c3 Merge branch '4.4' into 5.0
* 4.4:
  [PhpUnitBridge] fix bad detection of unsilenced deprecations
  [Security] Unserialize $parentData, if needed, to avoid errors
  [HttpKernel] Fix error logger when stderr is redirected to /dev/null (FPM)
2020-05-19 10:31:00 +02:00
Nicolas Grekas
fd584bb9b3 Merge branch '3.4' into 4.4
* 3.4:
  [PhpUnitBridge] fix bad detection of unsilenced deprecations
  [HttpKernel] Fix error logger when stderr is redirected to /dev/null (FPM)
2020-05-19 10:30:42 +02:00
Fabien Potencier
8e428ed217 bug #36867 [PhpUnitBridge] fix bad detection of unsilenced deprecations (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[PhpUnitBridge] fix bad detection of unsilenced deprecations

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

Commits
-------

9d5bb11ec9 [PhpUnitBridge] fix bad detection of unsilenced deprecations
2020-05-19 10:23:06 +02:00
Nicolas Grekas
9d5bb11ec9 [PhpUnitBridge] fix bad detection of unsilenced deprecations 2020-05-19 10:12:21 +02:00
Nicolas Grekas
638b200c24 bug #36862 [Security] Unserialize $parentData, if needed, to avoid errors (rfaivre)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Security] Unserialize $parentData, if needed, to avoid errors

Check that the $parentData is an array. If it's a string, the variable is unserialized.
Useful to not break the compatibility with the older versions.
Bug reproduced when upgrading from 3.4 to 4.4

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36813
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Commits
-------

b447433b67 [Security] Unserialize $parentData, if needed, to avoid errors
2020-05-18 23:38:47 +02:00
rfaivre
b447433b67 [Security] Unserialize $parentData, if needed, to avoid errors 2020-05-18 23:38:28 +02:00
Fabien Potencier
7ee33f9e82 bug #36855 [HttpKernel] Fix error logger when stderr is redirected to /dev/null (fabpot)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] Fix error logger when stderr is redirected to /dev/null

| Q             | A
| ------------- | ---
| Branch?       | 3.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       | n/a <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | n/a

The HttpKernel Logger is meant to be used as a last resort logging mechanism when no logger has been explicitly configured (Monolog is not a dependency for instance).

For small apps, that can be more than enough.

But under some circumstances, it does not work. When you are using PHP-FPM, `stderr` is ignored by default (`catch_workers_output` is `false`) and so, logs are ignored as well. There is no issue with the official PHP Docker image as the setting has been explicitly set to `true`. Not an issue with Symfony CLI as well, as we also change the setting. Not a problem either with the PHP built-in server as it does not use PHP FPM anyway.

But, in many other places, where the setting has its default value, logs are lost (as you can imagine, it happened to me). As this feature is meant to be a fallback, I think it should always work, or at least, we need to make everything possible to make it work out of the box; that's why I've considered it a bug and hence a PR on 3.4.

This PR changes the default value for the output to `null`, which uses `error_log()` instead of `stderr` to log errors. Why is it better? The output of `error_log()` is controllable by the `error_logs` PHP ini setting and it is well understood by everyone (the default configuration should always work well); so it should work in most/more cases.

The other change (to be discussed) is to also log messages at the `ERROR` level and not just the `CRITICAL` ones.

/cc @dunglas

Commits
-------

5f829bdaeb [HttpKernel] Fix error logger when stderr is redirected to /dev/null (FPM)
2020-05-18 21:01:45 +02:00
Nicolas Grekas
1357cbf8ed [Validator] allow passing a validator to Validation::createCallable() 2020-05-18 18:55:18 +02:00
Fabien Potencier
5f829bdaeb [HttpKernel] Fix error logger when stderr is redirected to /dev/null (FPM) 2020-05-18 17:28:46 +02:00
Fabien Potencier
24067f1889 Merge branch '5.0' into 5.1
* 5.0:
  Revert "Change priority of KernelEvents::RESPONSE subscriber"
2020-05-18 09:51:22 +02:00
Fabien Potencier
08f204c79a Merge branch '4.4' into 5.0
* 4.4:
  Revert "Change priority of KernelEvents::RESPONSE subscriber"
2020-05-18 09:51:10 +02:00
Fabien Potencier
87c6683a98 bug #36838 [HttpKernel] Bring back the debug toolbar (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] Bring back the debug toolbar

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36836
| License       | MIT
| Doc PR        | N/A

This PR effectively reverts #36789 in order to fix a regression caused by that PR.

Commits
-------

9f8d225aa1 Revert "Change priority of KernelEvents::RESPONSE subscriber"
2020-05-18 09:50:27 +02:00
Alexander M. Turek
9f8d225aa1 Revert "Change priority of KernelEvents::RESPONSE subscriber"
This reverts commit 6ed624ad16.
2020-05-16 15:57:47 +02:00
vudaltsov
eb8d626c27 Properties $originalName and $mimeType are never null in UploadedFile 2020-05-16 16:15:54 +03:00
Fabien Potencier
21dc296b18 bumped Symfony version to 5.1.0 2020-05-16 14:36:23 +02:00
Fabien Potencier
2c30da66d3
Merge pull request #36835 from fabpot/release-5.1.0-RC1
released v5.1.0-RC1
2020-05-16 14:32:11 +02:00
Fabien Potencier
73acbab57b updated VERSION for 5.1.0-RC1 2020-05-16 14:31:53 +02:00
Fabien Potencier
fa99d6954d updated CHANGELOG for 5.1.0-RC1 2020-05-16 14:31:46 +02:00
Nicolas Grekas
c268915352 bug #36832 [Security] Improved upgrade path for custom remember me services (wouterj)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Security] Improved upgrade path for custom remember me services

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | -
| Deprecations? | -
| Tickets       | https://github.com/symfony/symfony/pull/36806#issuecomment-628592543
| License       | MIT
| Doc PR        |

This improves the upgrade path for custom remember me services now `LogoutHandlerInterface` has been deprecated.

As suggested in https://github.com/symfony/symfony/pull/36806#issuecomment-628592543, the `logout()` method should be added to the `RememberMeServicesInterface` in Symfony 6.

This patch allows developers to write a custom class implementing only `RememberMeServicesInterface` with a `logout()` method. Requiring them to implement `LogoutHandlerInterface` will mean they have to maintain 2 version of the class to support both Symfony 5.1+ and 6.0.

Commits
-------

c49d00f984 Added deprecation for RememberMe services without logout() method
2020-05-16 13:32:52 +02:00