Commit Graph

48717 Commits

Author SHA1 Message Date
Antonio Pauletich
a07578dba3 [HttpClient] Fix scoped client without query option configuration 2020-04-07 14:53:04 +02:00
Grégoire Pineau
a00a2f1115 [Workflow] Use a strict comparison when retrieving raw marking in MarkingStore 2020-04-07 11:51:42 +02:00
Grégoire Pineau
aebe8ae163 [Workflow] Use a strict comparison when retrieving raw markin in MarkingStore 2020-04-07 11:39:41 +02:00
Grégoire Pineau
903a57dbd9 [VarCloner] Cut Logger in dump 2020-04-07 00:58:33 +02:00
Ahmed TAILOULOUTE
c3f5e2c1c8 [OptionsResolver] Improve the deprecation feature by handling package + version 2020-04-06 19:48:46 +02:00
Thomas Calvet
d4eb4a4bd7 [ErrorHandler] Remove trigger_deprecation frame from trace (add tests) 2020-04-06 12:56:40 +02:00
Nicolas Grekas
c293aee9ab [ErrorHandler] Remove trigger_deprecation frame from trace 2020-04-06 12:56:40 +02:00
Nicolas Grekas
bfe6b6fb41 Merge branch '5.0'
* 5.0:
  [PropertyAccess] fix tests
  [WebProfilerBundle] fix test
  remove assertions that can never be reached
  [PropertyAccess] Improve message of unitialized property in php 7.4
  [HttpFoundation] Fixed session migration with custom cookie lifetime
  [HttpKernel][FrameworkBundle] fix compat with Debug component
  [Serializer] Remove unused variable
  Allow URL-encoded special characters in basic auth part of URLs
  [Serializer] Fix unitialized properties (from PHP 7.4.2) when serializing context for the cache key
  [Validator] Add missing Ukrainian and Russian translations
  Track session usage when setting the token
  [4.4][MonologBridge] Fix $level type
  [5.0][MonologBridge] Fix $level type
  No need to reconnect the bags to the session
  Support for Content Security Policy style-src-elem and script-src-elem in WebProfiler
  [PropertyInfo][ReflectionExtractor] Check the array mutator prefixes last when the property is singular
  [Security][Http][SwitchUserListener] Ignore all non existent username protection errors
  Add installation and minimal example to README
2020-04-06 12:46:53 +02:00
Nicolas Grekas
cc24b55e04 Merge branch '4.4' into 5.0
* 4.4:
  [PropertyAccess] fix tests
  [WebProfilerBundle] fix test
  remove assertions that can never be reached
  [PropertyAccess] Improve message of unitialized property in php 7.4
  [HttpFoundation] Fixed session migration with custom cookie lifetime
  [HttpKernel][FrameworkBundle] fix compat with Debug component
  [Serializer] Remove unused variable
  Allow URL-encoded special characters in basic auth part of URLs
  [Serializer] Fix unitialized properties (from PHP 7.4.2) when serializing context for the cache key
  [Validator] Add missing Ukrainian and Russian translations
  Track session usage when setting the token
  [4.4][MonologBridge] Fix $level type
  No need to reconnect the bags to the session
  Support for Content Security Policy style-src-elem and script-src-elem in WebProfiler
  [PropertyInfo][ReflectionExtractor] Check the array mutator prefixes last when the property is singular
  [Security][Http][SwitchUserListener] Ignore all non existent username protection errors
  Add installation and minimal example to README
2020-04-06 12:40:56 +02:00
Nicolas Grekas
f72dd9cafa Merge branch '3.4' into 4.4
* 3.4:
  [PropertyAccess] fix tests
  [WebProfilerBundle] fix test
  remove assertions that can never be reached
  [PropertyAccess] Improve message of unitialized property in php 7.4
  [HttpFoundation] Fixed session migration with custom cookie lifetime
  [Serializer] Remove unused variable
  Allow URL-encoded special characters in basic auth part of URLs
  [Serializer] Fix unitialized properties (from PHP 7.4.2) when serializing context for the cache key
  [Validator] Add missing Ukrainian and Russian translations
  No need to reconnect the bags to the session
  Support for Content Security Policy style-src-elem and script-src-elem in WebProfiler
  [PropertyInfo][ReflectionExtractor] Check the array mutator prefixes last when the property is singular
2020-04-06 12:16:26 +02:00
Nicolas Grekas
547c99eae5 bug #36305 [PropertyInfo][ReflectionExtractor] Check the array mutator prefixes last when the property is singular (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[PropertyInfo][ReflectionExtractor] Check the array mutator prefixes last when the property is singular

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

Check the related tickets that have a very descriptive example.

If the property is singular, we should prioritize non array mutator prefixes and do the opposite for plural property. It relies on some guessing but it actually fixes real world scenarios.

Commits
-------

b4df2b9dff [PropertyInfo][ReflectionExtractor] Check the array mutator prefixes last when the property is singular
2020-04-06 12:11:23 +02:00
Nicolas Grekas
995ef18f95 [PropertyAccess] fix tests 2020-04-06 12:01:14 +02:00
Fabien Potencier
dadb5d8198 minor #36354 Revert to container.dumper.inline_factories=false by default (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

Revert to container.dumper.inline_factories=false by default

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

As spotted by @Tobion in https://github.com/symfony/symfony/pull/36193#pullrequestreview-387892170

Commits
-------

2b6f1e9a93 Revert to container.dumper.inline_factories=false by default
2020-04-06 11:54:21 +02:00
Nicolas Grekas
a20110c6b6 [WebProfilerBundle] fix test 2020-04-06 11:49:16 +02:00
Nicolas Grekas
434a03ab3c minor #36355 [OptionsResolver] remove assertions that can never be reached (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[OptionsResolver] remove assertions that can never be reached

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

Commits
-------

112b5de3cf remove assertions that can never be reached
2020-04-06 10:50:03 +02:00
Nicolas Grekas
2b6f1e9a93 Revert to container.dumper.inline_factories=false by default 2020-04-06 10:46:45 +02:00
Christian Flothmann
112b5de3cf remove assertions that can never be reached 2020-04-06 10:30:32 +02:00
Fabien Potencier
efc93a7e17 minor #36311 [PropertyAccess] Improve message of unitialized property in php 7.4 (lmasforne)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[PropertyAccess] Improve message of unitialized property in php 7.4

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

Improve message of unitialized property in php 7.4 ;
Before
You should either initialize it or make it nullable using "?string" instead.
After
You should either initialize it or make it nullable using "?string $var = null" instead.

Commits
-------

3c8bf2d29d [PropertyAccess] Improve message of unitialized property in php 7.4
2020-04-06 10:09:12 +02:00
Laurent Masforné
3c8bf2d29d [PropertyAccess] Improve message of unitialized property in php 7.4 2020-04-06 10:09:05 +02:00
Fabien Potencier
402909ff7b feature #35748 [HttpFoundation] Add support for all core response http control directives (azjezz)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[HttpFoundation] Add support for all core response http control directives

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

Add support for all core cache-control directives

see : https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control

Commits
-------

011cd38974 [HttpFoundation] Add support for all core http control directives
2020-04-05 12:28:07 +02:00
Nicolas Grekas
5517fbcdcb feature #36270 [FrameworkBundle] Add file links to named controllers in debug:router (chalasr)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[FrameworkBundle] Add file links to named controllers in debug:router

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

Before
![Screenshot 2020-03-31 at 21 52 11](https://user-images.githubusercontent.com/7502063/78069168-ee189380-7399-11ea-90ef-dedce6f96131.png)

After
![Screenshot 2020-03-31 at 21 51 11](https://user-images.githubusercontent.com/7502063/78069198-fb358280-7399-11ea-8ab8-eaa24f76bbac.png)

Commits
-------

932ae91c74 [FrameworkBundle] Add file links to named controllers in debug:router
2020-04-05 12:04:27 +02:00
Nicolas Grekas
0647508b11 feature #35762 [Asset] Allows to download asset manifest over HTTP (GromNaN)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Asset] Allows to download asset manifest over HTTP

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #35761 Fix #33001
| License       | MIT
| Doc PR        | symfony/symfony-docs#13255

```yaml
framework:
    assets:
        json_manifest_path: 'https://cdn.example.com/manifest.json'
```

Commits
-------

4ba12a80e5 [Asset] Allows to download json manifest from a remote url
2020-04-05 12:00:14 +02:00
Nicolas Grekas
78770e7f7c bug #35656 [HttpFoundation] Fixed session migration with custom cookie lifetime (Guite)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[HttpFoundation] Fixed session migration with custom cookie lifetime

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

This PR adds the fix proposed in https://github.com/symfony/symfony/issues/28577#issuecomment-578052397

Commits
-------

3e824de385 [HttpFoundation] Fixed session migration with custom cookie lifetime
2020-04-05 11:49:58 +02:00
Guite
3e824de385 [HttpFoundation] Fixed session migration with custom cookie lifetime 2020-04-05 11:49:47 +02:00
Fabien Potencier
3b38f38add feature #36195 [DI] add tags container.preload/.no_preload to declare extra classes to preload/services to not preload (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[DI] add tags `container.preload`/`.no_preload` to declare extra classes to preload/services to not preload

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

To allow fine-grained declaration of sidekick classes in DI extensions.
Follows #36103

Commits
-------

fb04711b40 [DI] add tags `container.preload`/`.no_preload` to declare extra classes to preload/services to not preload
2020-04-05 09:04:21 +02:00
Nicolas Grekas
fb04711b40 [DI] add tags container.preload/.no_preload to declare extra classes to preload/services to not preload 2020-04-05 09:04:12 +02:00
Fabien Potencier
8a2a69f332 feature #36209 [HttpKernel] allow cache warmers to add to the list of preloaded classes and files (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[HttpKernel] allow cache warmers to add to the list of preloaded classes and files

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

This PR makes cache warmers responsible for returning a list of classes or files to preload. It does so by adding the following to `WarmableInterface::warmUp()`:
`@return string[] A list of classes or files to preload on PHP 7.4+`

Of course, this return value is properly implemented so that we can see what this provides in practice. Here are the benchmarks on a simple Hello World rendered with Twig:
- without preloading: 360 req/s
- with preloading in master: 560 req/s (+55%)
- with preloading and this PR: 630 req/s (+75%)

Commits
-------

8ab75d99d4 [HttpKernel] allow cache warmers to add to the list of preloaded classes and files
2020-04-05 09:00:42 +02:00
Fabien Potencier
ddfb3089c9 Fixed CS 2020-04-05 08:49:38 +02:00
Fabien Potencier
a56f98cbdc bug #36342 [HttpKernel][FrameworkBundle] fix compat with Debug component (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel][FrameworkBundle] fix compat with Debug component

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

Fixes the issue as described by @stof in #36009

Commits
-------

d5c54c2fa7 [HttpKernel][FrameworkBundle] fix compat with Debug component
2020-04-05 08:42:43 +02:00
Fabien Potencier
6f57fcf9b7 minor #35933 [Mime] strengthen is_resource() checks (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Mime] strengthen is_resource() checks

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

Improves seekable checks by using
`stream_get_meta_data($h)['seekable'] && 0 === fseek($h, 0, SEEK_CUR)`
instead of just
`stream_get_meta_data($h)['seekable']`

which is better when using userland stream wrappers.

Commits
-------

be9c675710 [Mime] strengthen is_resource() checks
2020-04-05 08:41:07 +02:00
Robin Chalas
a165ecca73 fix cs 2020-04-05 01:14:36 +02:00
Daniel STANCU
e242cc35e9 Git rebase form master 2020-04-04 23:55:02 +03:00
Nicolas Grekas
1c73297ad0 minor #36344 [Security] Fixed build after LogoutListener changes (wouterj)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Security] Fixed build after LogoutListener changes

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

Commits
-------

253cc4ec41 Fixed build after LogoutListener changes
2020-04-04 21:47:13 +02:00
Wouter de Jong
253cc4ec41 Fixed build after LogoutListener changes 2020-04-04 20:35:10 +02:00
Nicolas Grekas
d5c54c2fa7 [HttpKernel][FrameworkBundle] fix compat with Debug component 2020-04-04 13:58:35 +02:00
Fabien Potencier
1fc7b86f07 feature #36243 [Security] Refactor logout listener to dispatch an event instead (wouterj)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

[Security] Refactor logout listener to dispatch an event instead

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes (sort of...)
| New feature?  | yes
| Deprecations? | yes
| Tickets       | Fix #25212, Fix #22473
| License       | MIT
| Doc PR        | tbd

The current `LogoutListener` has some extension points, but they are not really DX-friendly (ref #25212). It requires hacking a `addMethodCall('addHandler')` in the container builder to register a custom logout handler.
Also, it is impossible to overwrite the default logout functionality from a bundle (ref #22473).

This PR introduces a `LogoutEvent` that replaces both the `LogoutSuccessHandlerInterface` and `LogoutHandlerInterface`. This provides a DX-friendly extension point and also cleans up the authentication factories (no more `addMethodCall()`'s).

In order to allow different logout handlers for different firewalls, I created a specific event dispatcher for each firewall (as also shortly discussed in #33558). The `dispatcher` tag attribute allows you to specify which dispatcher it should be registered to (defaulting to the global dispatcher). The `EventBubblingLogoutListener` also dispatches logout events on the global dispatcher, to be used for listeners that should run on all firewalls.

_@weaverryan and I discussed this feature while working on #33558, but figured it was unrelated and could be done while preservering BC. So that's why a separate PR is created._

Commits
-------

a9f096eb1f [Security] Refactor logout listener to dispatch an event instead
2020-04-04 13:02:32 +02:00
Wouter de Jong
a9f096eb1f [Security] Refactor logout listener to dispatch an event instead 2020-04-04 13:02:21 +02:00
Nicolas Grekas
8ab75d99d4 [HttpKernel] allow cache warmers to add to the list of preloaded classes and files 2020-04-04 11:52:45 +02:00
Fabien Potencier
d33392f136 minor #36246 [Routing] Add installation and minimal example to README (wouterj)
This PR was merged into the 4.4 branch.

Discussion
----------

[Routing] Add installation and minimal example to README

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | n/a
| License       | MIT
| Doc PR        | symfony/symfony-docs#13431

Similair to what I did in #35552, this PR updates the README of the Routing component to include a minimal example and installation command.

Commits
-------

be6612060c Add installation and minimal example to README
2020-04-04 11:11:00 +02:00
Fabien Potencier
9b41a3233d minor #36341 [Serializer] Remove unused variable (dunglas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Serializer] Remove unused variable

| Q             | A
| ------------- | ---
| Branch?       | 3.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       | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

3e943435c9 [Serializer] Remove unused variable
2020-04-04 11:08:51 +02:00
Fabien Potencier
004f1f3823 bug #36315 [WebProfilerBundle] Support for Content Security Policy style-src-elem and script-src-elem in WebProfiler (ampaze)
This PR was merged into the 3.4 branch.

Discussion
----------

[WebProfilerBundle] Support for Content Security Policy style-src-elem and script-src-elem in WebProfiler

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

If a `style-src-elem` or `script-src-elem` Content Security Policy exist, the WebProfiler Styles or Scripts will be rejected as the nonce is missing.

Commits
-------

7f33f1fa3a Support for Content Security Policy style-src-elem and script-src-elem in WebProfiler
2020-04-04 10:50:20 +02:00
Kévin Dunglas
3e943435c9
[Serializer] Remove unused variable 2020-04-04 09:51:57 +02:00
Fabien Potencier
fdd8ac5f25 feature #36185 [Messenger] Add a \Throwable argument in RetryStrategyInterface methods (Benjamin Dos Santos)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

[Messenger] Add a \Throwable argument in RetryStrategyInterface methods

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

This allows to define new retry strategies based on the exceptions thrown during the last handling.

Commits
-------

5fa9d68e8b [Messenger] Add a \Throwable argument in RetryStrategyInterface methods
2020-04-04 09:33:17 +02:00
Benjamin Dos Santos
5fa9d68e8b [Messenger] Add a \Throwable argument in RetryStrategyInterface methods 2020-04-04 09:33:12 +02:00
Fabien Potencier
21a6ab0420 minor #36274 [HttpFoundation] No need to reconnect the bags to the session after session_regenerate_id (rosier)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpFoundation] No need to reconnect the bags to the session after session_regenerate_id

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

Bug https://bugs.php.net/70013 was fixed before the release of PHP v7.0

https://3v4l.org/A8YmY

Related to https://github.com/symfony/symfony/pull/15243

Commits
-------

923c24f438 No need to reconnect the bags to the session
2020-04-04 09:29:17 +02:00
Fabien Potencier
6254cdb0f4 bug #36286 [Validator] Allow URL-encoded special characters in basic auth part of URLs (cweiske)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead.

Discussion
----------

[Validator] Allow URL-encoded special characters in basic auth part of URLs

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

Special characters in HTTP Basic Auth passwords in an URL need to be url-encoded.

Example: `foo@bar` becomes `foo%40bar`, in an URL: `http://user:foo%40bar@example.org`

The UrlValidator did not allow percent signs in username and password, and this is changed now.

Commits
-------

8a56c506e3 Allow URL-encoded special characters in basic auth part of URLs
2020-04-04 09:24:28 +02:00
Christian Weiske
8a56c506e3 Allow URL-encoded special characters in basic auth part of URLs
Resolves: https://github.com/symfony/symfony/issues/36285
2020-04-04 09:24:28 +02:00
Fabien Potencier
5aeecc2dab bug #36297 [Form] action allows only strings (maxhelias)
This PR was submitted for the 5.0 branch but it was merged into the 5.1-dev branch instead.

Discussion
----------

[Form] action allows only strings

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

On updating an old project that had actions to null it's caused me a type-hint error. With that, we can quickly identify where the problem is

Commits
-------

e861500ce8 [Form] action allows only strings
2020-04-04 09:23:05 +02:00
Maxime Helias
e861500ce8 [Form] action allows only strings 2020-04-04 09:22:59 +02:00
Fabien Potencier
38cbcc6d4f bug #36335 [Security] Track session usage whenever a new token is set (wouterj)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security] Track session usage whenever a new token is set

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

When using `anonymous: lazy`, the programatic login using the guard handler is broken. As the `setToken()` does not track usage, the index remains equal.

I tried fixing this more properly in e.g. the `SessionStrategy::onAuthentication` class, but I couldn't get it working (as `$request->hasPreviousSession()` returns false, the session strategy isn't called). `setToken()` can also not be made usage tracking afaics, because it would directly break (`setToken(null)` is called in `ContextListener`).

The current fix does however look really ugly, but I can't find anything better with my minor knowledge of this session usage tracking feature. I'm open for all ideas :)

Commits
-------

8d96dbd08b Track session usage when setting the token
2020-04-04 09:19:12 +02:00