Commit Graph

47066 Commits

Author SHA1 Message Date
vudaltsov eb8d626c27 Properties $originalName and $mimeType are never null in UploadedFile 2020-05-16 16:15:54 +03:00
Nicolas Grekas 94e8c42736 Merge branch '3.4' into 4.4
* 3.4:
  [VarDumper] fix for change in PHP 7.4.6 (bis)
  [BrowserKit] Allow Referer set by history to be overridden (3.4)
2020-05-16 12:07:46 +02:00
Nicolas Grekas cb7e78c809 bug #36592 [BrowserKit] Allow Referer set by history to be overridden (Slamdunk)
This PR was merged into the 3.4 branch.

Discussion
----------

[BrowserKit] Allow Referer set by history to be overridden

| Q             | A
| ------------- | ---
| Branch?       | 3.4, see https://github.com/symfony/symfony/pull/36591 for 5.0
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Commits
-------

4774946fbd [BrowserKit] Allow Referer set by history to be overridden (3.4)
2020-05-16 12:06:03 +02:00
Nicolas Grekas e69673562c [VarDumper] fix for change in PHP 7.4.6 (bis) 2020-05-16 12:04:57 +02:00
Nicolas Grekas 1e9486de89 [VarExporter] fix for change in PHP 7.4.6 2020-05-16 12:04:25 +02:00
Nicolas Grekas cc519aa5a9 bug #36823 [HttpClient] fix PHP warning + accept status code >= 600 (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] fix PHP warning + accept status code >= 600

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

This fixes the PHP warning reported in the linked issue.

This also relaxes the accepted status codes, with https://www.linkedin.com/company/linkedin/ as an example that returns a non-conformant one (`999`).

These are now handled as 5xx codes, ie they trigger a ServerException.

Commits
-------

c764b5c36e [HttpClient] fix PHP warning + accept status code >= 600
2020-05-16 11:09:03 +02:00
Nicolas Grekas bce37603cb bug #36824 [Security/Core] fix compat of `NativePasswordEncoder` with pre-PHP74 values of `PASSWORD_*` consts (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security/Core] fix compat of `NativePasswordEncoder` with pre-PHP74 values of `PASSWORD_*` consts

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

Commits
-------

df32171cb2 [Security/Core] fix compat of `NativePasswordEncoder` with pre-PHP74 values of `PASSWORD_*` consts
2020-05-16 11:07:52 +02:00
Nicolas Grekas ae67376ad3 bug #36811 [DependencyInjection] Fix register event listeners compiler pass (X-Coder264)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] Fix register event listeners compiler pass

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

I've wanted to use the simpler event listener registration syntax (https://symfony.com/blog/new-in-symfony-4-4-simpler-event-listeners) in my project and it didn't work so I'm sending this fix.

We use the `KnpPaginatorBundle` bundle which also [calls the `RegisterListenersPass` compiler pass](https://github.com/KnpLabs/KnpPaginatorBundle/blob/v5.2.0/src/DependencyInjection/Compiler/PaginatorConfigurationPass.php#L22) in order to register with the event dispatcher their custom tags for listeners and subscribers (`knp_paginator.listener` and `knp_paginator.subscriber`).

Their compiler pass is `TYPE_BEFORE_REMOVING` and priority zero which is the same type and priority as the pass that gets [added by FrameworkBundle](https://github.com/symfony/symfony/blob/v4.4.8/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php#L125). Since both the type and priority is the same the order of execution is `undefined` (because [that is how regular sort behaves in PHP which is used by default by `krsort`](https://github.com/symfony/symfony/blob/v4.4.8/src/Symfony/Component/DependencyInjection/Compiler/PassConfig.php#L264)) and the `RegisterListenersPass` currently removes the `eventAliasesParameter` parameter from the container if it is set (which is [set here](https://github.com/symfony/symfony/blob/v4.4.8/src/Symfony/Bundle/FrameworkBundle/Resources/config/services.xml#L9)). So what happens in my app is that the Knp compiler pass runs first, the `event_dispatcher.event_aliases` parameter is removed and then the FrameworkBundle registered compiler pass runs and since the aliases are not present anymore the events do not get aliased properly. The event dispatcher service in the compiled container looks like:

```php
$instance->addListener('Symfony\Component\HttpKernel\Event\RequestEvent', ...);
```

instead of the expected

```php
$instance->addListener('kernel.request', ...);
```

This means that my listener never gets called on the kernel request event.

Another potential fix would be to adjust the Knp compiler pass priority, but seeing as that would fix only that bundle (who knows how many bundles out there have the same problem) and that I don't see any drawback in letting the `event_dispatcher.event_aliases` parameter stay in the container I think that this is better to fix here.

Commits
-------

646878d072 Fix register event listeners compiler pass
2020-05-16 11:07:08 +02:00
Nicolas Grekas fb4c3f920f Merge branch '3.4' into 4.4
* 3.4:
  [VarDumper] fix for change in PHP 7.4.6
  Added regression test for AccountStatusException behavior (ref #36822)
  embed resource name in error message
  [Serializer] fix issue with PHP 8
  [Yaml] Fix escaped quotes in quoted multi-line string
2020-05-16 11:03:35 +02:00
Nicolas Grekas 924822c2e8 [VarDumper] fix for change in PHP 7.4.6 2020-05-16 10:59:45 +02:00
Nicolas Grekas cec0dfe5b3 minor #36780 [Translator] embed resource name in error message (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Translator] embed resource name in error message

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

Someone reported on Slack that they accidentally stored a translation file with the `.twig` extension and that the error message was quite confusing.

Commits
-------

507a5963e4 embed resource name in error message
2020-05-16 10:35:38 +02:00
Nicolas Grekas 30e2543b49 minor #36829 [Security] Update test to test AccountStatusException behavior (wouterj)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security] Update test to test AccountStatusException behavior

| Q             | A
| ------------- | ---
| Branch?       | 3.4 (behavior is this way since 2.0)
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

See https://github.com/symfony/symfony/pull/36822

This PR updates the `AccountStatusException` test to test the expected behavior of this exception (and its difference from `AuthenticationException`).

Commits
-------

08fbfcf5a0 Added regression test for AccountStatusException behavior (ref #36822)
2020-05-16 10:33:51 +02:00
Wouter J 08fbfcf5a0 Added regression test for AccountStatusException behavior (ref #36822) 2020-05-15 23:22:25 +02:00
Nicolas Grekas c764b5c36e [HttpClient] fix PHP warning + accept status code >= 600 2020-05-15 16:28:26 +02:00
Nicolas Grekas df32171cb2 [Security/Core] fix compat of `NativePasswordEncoder` with pre-PHP74 values of `PASSWORD_*` consts 2020-05-15 14:38:59 +02:00
Christian Flothmann 507a5963e4 embed resource name in error message 2020-05-15 09:32:03 +02:00
Nicolas Grekas 9bcf9c1e02 minor #36791 [FrameworkBundle] fix stringable annotation (nicolas-grekas)
This PR was submitted for the master branch but it was merged into the 4.4 branch instead.

Discussion
----------

[FrameworkBundle] fix stringable annotation

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

Commits
-------

65e6812c1d [FrameworkBundle] fix stringable annotation
2020-05-14 20:47:23 +02:00
Nicolas Grekas 65e6812c1d [FrameworkBundle] fix stringable annotation 2020-05-14 20:47:17 +02:00
Fabien Potencier e5c82c566e bug #36789 Change priority of KernelEvents::RESPONSE subscriber (marcw)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

Change priority of KernelEvents::RESPONSE subscriber

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

This PR changes the priority of the `KernelEvents::RESPONSE` subscriber of the `ProfilerListener` so that it is the penultimate to be executed (just before `StreamedResponseListener`).

The reason is that other listeners that were executed after this one CAN change the response (such as `SessionListener` for example). This creates a headache when debugging, with a discrepancy between what is shown in a curl command, and by the Symfony profiler.

Commits
-------

6ed624ad16 Change priority of KernelEvents::RESPONSE subscriber
2020-05-14 11:30:03 +02:00
Marc Weistroff 6ed624ad16 Change priority of KernelEvents::RESPONSE subscriber 2020-05-14 11:29:57 +02:00
Fabien Potencier 8f2c68fc60 bug #36794 [Serializer] fix issue with PHP 8 (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Serializer] fix issue with PHP 8

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

The current logic is a bit strange but I guess it's some legacy from PHP 5.

This keeps the current behavior while skipping the use of `ReflectionParameter::getClass()`, which [is deprecated in PHP 8](http://git.php.net/?p=php-src.git;a=commitdiff;h=28af364d2ae2261addc21f8830f175baa8fa72cf).

Commits
-------

44b45cbaf1 [Serializer] fix issue with PHP 8
2020-05-13 19:01:16 +02:00
Fabien Potencier 315010422f bug #36786 [WebProfiler] Remove 'none' when appending CSP tokens (ndench)
This PR was merged into the 4.4 branch.

Discussion
----------

[WebProfiler] Remove 'none' when appending CSP tokens

| Q             | A
| ------------- | ---
| Branch?       | 3.4, 4.4, 5.0
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36645
| License       | MIT
| Doc PR        | n/a

@nicolas-grekas  asked me to to have a look at this after #36678.

If a user has a CSP policy of `default-src 'none'`, then the WebProfiler copies `'none'` to `script-src` and `style-src` then adds other sources. This creates an invalid policy since `'none'` is only allowed when it's the only item in the source list.

This will probably need to be merged into 3.4 first, I started on 4.4 so I can test in my current symfony project which requires 4.4.

Commits
-------

967bc4a860 [WebProfiler] Remove 'none' when appending CSP tokens
2020-05-13 19:00:16 +02:00
Antonio Pauletich 646878d072 Fix register event listeners compiler pass 2020-05-13 18:27:55 +02:00
Fabien Potencier b4342e3a9b minor #36795 [Messenger] Missing description in `messenger:setup-transports` command (carlosbuenosvinos)
This PR was submitted for the master branch but it was merged into the 4.4 branch instead.

Discussion
----------

[Messenger] Missing description in `messenger:setup-transports` command

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

making `bin/console` to show an empty description when the rest of the commands have one.

![image](https://user-images.githubusercontent.com/351553/81716773-122bc200-947a-11ea-84ef-18ec8d19e479.png)

Commits
-------

d31d1e0111 Missing description in `messenger:setup-transports` command
2020-05-12 22:53:02 +02:00
Carlos Buenosvinos d31d1e0111 Missing description in `messenger:setup-transports` command
making `bin/console` to show an empty description when the rest of the commands have one.
2020-05-12 22:52:55 +02:00
Nicolas Grekas 44b45cbaf1 [Serializer] fix issue with PHP 8 2020-05-12 22:34:06 +02:00
Nathan Dench 967bc4a860 [WebProfiler] Remove 'none' when appending CSP tokens 2020-05-12 17:24:37 +10:00
Fabien Potencier a8cb3cd2da bug #36743 [Yaml] Fix escaped quotes in quoted multi-line string (ossinkine)
This PR was merged into the 3.4 branch.

Discussion
----------

[Yaml] Fix escaped quotes in quoted multi-line string

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

This PR continues https://github.com/symfony/symfony/pull/19304

This PR fixes incorrect parsing quoted multi-line string which contain escaped quotes, see tests

Commits
-------

2e99caacaf [Yaml] Fix escaped quotes in quoted multi-line string
2020-05-11 09:51:54 +02:00
Fabien Potencier 6541ac2d03 bug #36777 [TwigBundle] FormExtension does not have a constructor anymore since sf 4.0 (Tobion)
This PR was merged into the 4.4 branch.

Discussion
----------

[TwigBundle] FormExtension does not have a constructor anymore since sf 4.0

| 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        |

Commits
-------

35e391aaa2 [TwigBundle] FormExtension does not have a constructor anymore since sf 4.0
2020-05-10 18:07:44 +02:00
Tobias Schultze 35e391aaa2 [TwigBundle] FormExtension does not have a constructor anymore since sf 4.0 2020-05-10 16:50:02 +02:00
Nicolas Grekas 333f7187dc [HttpClient] fix testTimeoutIsNotAFatalError (bis) 2020-05-09 19:43:44 +02:00
Nicolas Grekas 00ae470307 [HttpClient] fix testTimeoutIsNotAFatalError 2020-05-09 18:24:06 +02:00
Nicolas Grekas 4ab6ff37bd [HttpClient] improve testTimeoutIsNotAFatalError 2020-05-09 17:57:30 +02:00
Fabien Potencier 6310084f25 bug #36716 [Mime] handle passing custom mime types as string (mcneely)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mime] handle passing custom mime types as string

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36715
| License       | MIT
| Doc PR        | none
Fix's issue where custom mimetypes were failing

Commits
-------

f3005ec653 Fix for #36715
2020-05-09 14:32:08 +02:00
Paul L. McNeely f3005ec653
Fix for #36715 2020-05-09 07:22:40 -05:00
Nicolas Grekas 99d5818489 minor #36771 [HttpClient] test that timeout is not fatal (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] test that timeout is not fatal

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

Commits
-------

36ccf4c65b [HttpClient] test that timeout is not fatal
2020-05-09 14:10:26 +02:00
Nicolas Grekas 36ccf4c65b [HttpClient] test that timeout is not fatal 2020-05-09 14:08:40 +02:00
Nicolas Grekas 3783200074 minor #36761 [PhpUnitBridge] fix bad test (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] fix bad test

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

Mutating the global state of the autoloader... terrible idea. This should fix tests and remove the lines we were wondering about in the CI:
`Undefined index: remaining selfCount in [...]`

Commits
-------

edb517699a [PhpUnitBridge] fix bad test
2020-05-08 14:34:26 +02:00
Nicolas Grekas edb517699a [PhpUnitBridge] fix bad test 2020-05-08 14:32:38 +02:00
Nicolas Grekas da8b9552ad Merge branch '3.4' into 4.4
* 3.4:
  [3.4] CS fixes
2020-05-08 12:54:34 +02:00
Nicolas Grekas 020fa77db9 minor #36757 [4.4] CS fixes (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[4.4] CS fixes

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

Commits
-------

eba09d47e7 [4.4] CS fixes
2020-05-08 12:54:24 +02:00
Nicolas Grekas 1e1060f2eb minor #36756 [3.4] CS fixes (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[3.4] CS fixes

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

Commits
-------

02b378f248 [3.4] CS fixes
2020-05-08 12:53:15 +02:00
Nicolas Grekas eba09d47e7 [4.4] CS fixes 2020-05-08 12:39:41 +02:00
Nicolas Grekas 02b378f248 [3.4] CS fixes 2020-05-08 12:38:31 +02:00
Nicolas Grekas 66cd9f470c Disable phpunit verbosity 2020-05-08 12:04:27 +02:00
Nicolas Grekas e75c227d79 bug #36747 Queue name is a required parameter (theravel)
This PR was submitted for the 5.0 branch but it was merged into the 4.4 branch instead.

Discussion
----------

Queue name is a required parameter

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

Queue name is required parameter, which means this block will just fail

Commits
-------

9d48eedbdc Queue name is a required parameter
2020-05-08 12:02:38 +02:00
theravel 9d48eedbdc Queue name is a required parameter 2020-05-08 12:02:31 +02:00
Nicolas Grekas a60937519b bug #36751 [Mime] fix bad method call on `EmailAddressContains` (Kocal)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mime] fix bad method call on `EmailAddressContains`

| 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        | -

There is no method `Address` on [`MailboxHeader`](https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/Mime/Header/MailboxHeader.php), but a method `getAddress`.

Commits
-------

227ebd2fe9 [Mime] fix bad method call on "EmailAddressContains"
2020-05-08 11:59:36 +02:00
Nicolas Grekas 2dbfeb9db9 Merge branch '3.4' into 4.4
* 3.4:
  [FrameworkBundle] display actual target for error in AssetsInstallCommand
  Remove patches for Doctrine bugs and deprecations
  [DI][EventDispatcher] added contract for implementation
2020-05-08 11:58:40 +02:00
Nicolas Grekas f6ae18e3ac minor #36710 [DI][EventDispatcher] added contract for implementation (bestform)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI][EventDispatcher] added contract for implementation

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

As described in the attached issue a comment in the documentation of the `EventSubscriberInterface` would be helpful to make sure users do not use logic based on runtime state in their implementation of `getSubscribedEvents`.

Commits
-------

88e43d4d4c [DI][EventDispatcher] added contract for implementation
2020-05-08 11:57:02 +02:00