Commit Graph

47833 Commits

Author SHA1 Message Date
Nicolas Grekas
03d60fce47 [HttpClient] Always "buffer" empty responses 2020-10-02 15:41:48 +02:00
Nicolas Grekas
3d39874a2c Merge branch '3.4' into 4.4
* 3.4:
  disallow FrameworkBundle 4.4+
  propagate validation groups to subforms
  [Form] [Validator] Add failing testcase to demonstrate group sequence issue
2020-10-02 14:43:11 +02:00
Nicolas Grekas
4be56f6932 bug #38380 [Form] propagate validation groups to subforms (johanderuijter, xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] propagate validation groups to subforms

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

Commits
-------

04f5698e29 propagate validation groups to subforms
e2c7c3373d [Form] [Validator] Add failing testcase to demonstrate group sequence issue
2020-10-02 14:37:04 +02:00
Nicolas Grekas
60bfdaa6b8 minor #38383 [FrameworkBundle] disallow FrameworkBundle 4.4+ (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] disallow FrameworkBundle 4.4+

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

Since #34619 (merged in 4.4.1) the request stack can no longer be passed as an argument to the `HtmlErrorRenderer` constructor. However, FrameworkBundle 4.4 refuses to be used with WebProfilerBundle 3.4 since #34369 (merged in 4.4.0-RC1).

Commits
-------

ad45e9cfdd disallow FrameworkBundle 4.4+
2020-10-02 14:28:27 +02:00
Christian Flothmann
ad45e9cfdd disallow FrameworkBundle 4.4+ 2020-10-02 14:18:20 +02:00
Nicolas Grekas
71875397e9 minor #38379 [HttpClient] fix unsetting context[ssl][peer_name] (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] fix unsetting context[ssl][peer_name]

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no (fixing a not released fix)
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix https://github.com/symfony/symfony/pull/38375#issuecomment-702621658
| License       | MIT
| Doc PR        | -

/cc @bohanyang could you please confirm this fixes it?

Commits
-------

8eb8a7c400 [HttpClient] fix unsetting context[ssl][peer_name]
2020-10-02 12:19:29 +02:00
Nicolas Grekas
8eb8a7c400 [HttpClient] fix unsetting context[ssl][peer_name] 2020-10-02 12:07:58 +02:00
Christian Flothmann
04f5698e29 propagate validation groups to subforms 2020-10-02 11:43:30 +02:00
Johan de Ruijter
e2c7c3373d [Form] [Validator] Add failing testcase to demonstrate group sequence issue
When using group sequences on a form, sometimes constraints are ignored even though they should fail.
2020-10-02 11:43:30 +02:00
Nicolas Grekas
0d8721fc01 Merge branch '3.4' into 4.4
* 3.4:
  Adjust expired range check
2020-10-02 10:38:15 +02:00
Nicolas Grekas
3cfd991ae6 bug #38377 [4.4] Ignore more deprecations for Mockery mocks (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[4.4] Ignore more deprecations for Mockery mocks

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

Commits
-------

1a801e8452 [4.4] Ignore more deprecations for Mockery mocks
2020-10-02 10:36:26 +02:00
Nicolas Grekas
aca260fbd0 bug #38375 [HttpClient] fix using proxies with NativeHttpClient (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] fix using proxies with NativeHttpClient

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

As spotted by @stof in https://github.com/symfony/symfony/pull/38368#issuecomment-702272737, we cannot use local DNS resolution with HTTP proxies.

Commits
-------

28f301bf03 [HttpClient] fix using proxies with NativeHttpClient
2020-10-02 10:29:59 +02:00
Nicolas Grekas
9c8a3009cf bug #38372 [Routing] fix using !important and defaults/reqs in inline route definitions (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Routing] fix using !important and defaults/reqs in inline route definitions

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

Commits
-------

826db225b7 [Routing] fix using !important and defaults/reqs in inline route definitions
2020-10-02 10:22:10 +02:00
Nicolas Grekas
28f301bf03 [HttpClient] fix using proxies with NativeHttpClient 2020-10-02 10:17:19 +02:00
Thomas Calvet
1a801e8452 [4.4] Ignore more deprecations for Mockery mocks 2020-10-02 09:34:48 +02:00
Fabien Potencier
9a5a856b18 bug #38373 [ErrorHandler][DebugClassLoader] Do not check Mockery mocks classes (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler][DebugClassLoader] Do not check Mockery mocks classes

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

Commits
-------

bbd12fe27f [ErrorHandler][DebugClassLoader] Do not check Mockery mocks classes
2020-10-02 07:33:00 +02:00
Nicolas Grekas
826db225b7 [Routing] fix using !important and defaults/reqs in inline route definitions 2020-10-01 18:25:17 +02:00
Thomas Calvet
bbd12fe27f [ErrorHandler][DebugClassLoader] Do not check Mockery mocks classes 2020-10-01 18:21:20 +02:00
Nicolas Grekas
abe0ecac91 bug #38368 [HttpClient] Fix using https with proxies (bohanyang)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[HttpClient] Fix using https with proxies

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

According to my test, when `request_fulluri` is set to true,
the host appears in the URL will be the Host header,
even if the Host header is set in the context http header.

Since HttpClient has its own DNS cache, the host inside the URL is usually an IP address.
So this can break many things.
```
{
  "args": {},
  "headers": {
    "Accept": "*/*",
    "Accept-Encoding": "gzip",
    "Host": "3.211.1.78",
    "User-Agent": "Symfony HttpClient/Native",
    "X-Amzn-Trace-Id": "Root=1-5f75a59e-62c8c81e4490e09c700d6180"
  },
  "origin": "xxx.xxx.xxx.xxx",
  "url": "https://3.211.1.78/get"
}
* Hostname was NOT found in DNS cache
* Added httpbin.org:0:3.211.1.78 to DNS cache
* Establish HTTP proxy tunnel to tcp://10.22.22.21:7777
> GET https://3.211.1.78/get HTTP/1.1
Accept: */*
Accept-Encoding: gzip
Host: httpbin.org
User-Agent: Symfony HttpClient/Native

< HTTP/1.1 200 OK
< Date: Thu, 01 Oct 2020 09:47:10 GMT
< Content-Type: application/json
< Content-Length: 300
< Connection: close
< Server: gunicorn/19.9.0
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Credentials: true
<
```

I've also found this https://github.com/guzzle/guzzle/issues/791

We can also create an option to make it customizable.

Commits
-------

7e0cd4e621 [HttpClient] Fix using https with proxies
2020-10-01 18:05:35 +02:00
Bohan Yang
7e0cd4e621 [HttpClient] Fix using https with proxies 2020-10-01 18:05:21 +02:00
Nicolas Grekas
dadce4bec7 bug #38350 [TwigBundle] Only remove kernel exception listener if twig is used (dmolineus)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[TwigBundle] Only remove kernel exception listener if twig is used

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

In a setup using the template engine but not twig as the template engine no exceptions are logged. This is caused by the twig-bundle which removes the `exception_listener` service. For my understanding this should only happen if twig is used as template engine. This PR fixes the logic that only for the case where twig is enabled as template engine the http kernel exception listener is removed. Otherwise the twig exception listener got removed now.

Disclaimer: I'm not too deep into the details, so maybe I oversee something why it's implemented the way it is.

Commits
-------

7c34f6e866 [TwigBundle] Only remove kernel exception listener if twig is used
2020-10-01 15:17:56 +02:00
David Molineus
7c34f6e866 [TwigBundle] Only remove kernel exception listener if twig is used 2020-10-01 15:17:48 +02:00
Fabien Potencier
1b6894781c bug #38360 [BrowserKit] Cookie expiration at current timestamp (iquito)
This PR was merged into the 3.4 branch.

Discussion
----------

[BrowserKit] Cookie expiration at current timestamp

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

In `Symfony\Component\BrowserKit\Cookie` a cookie is expired if the `expires` timestamp is in the past. I would like to change it to also be expired if the `expires` timestamp equals the current exact timestamp. This would still be in line with [RFC 6265](https://tools.ietf.org/html/rfc6265#section-4.1.2.1), as it states `The Expires attribute indicates the maximum lifetime of the cookie, represented as the date and time at which the cookie expires`.

Reason for this change: Cookies usually both have `expires` and `Max-Age` set, and Symfony sets `Max-Age` to zero if a cookie is expired (in `Symfony\Component\HttpFoundation\Cookie`). When converting cookies between string and object representations, `Max-Age` is the preferred source of truth for the expiration, but `Max-Age` set to zero is converted to an `expires` timestamp at this exact second, currently making the cookie not expired in `Symfony\Component\BrowserKit\Cookie`, even though it should be.

I noticed this discrepancy in my tests when checking if a cookie no longer existed after deleting it, yet it was still there, because `Cookie` thought it would only expire after the `expires` timestamp had passed. I am also thinking of raising an issue for `Symfony\Component\HttpFoundation\Cookie`, as importing and exporting an expired cookie (via strings) changes the `expired` value. I thought this change was a simpler one for now, and should have no negative/unexpected impact.

Commits
-------

9d187c0d1a Adjust expired range check
2020-10-01 12:44:36 +02:00
Andreas
9d187c0d1a Adjust expired range check
Include current second when deciding if cooke has expired.
2020-10-01 12:06:12 +02:00
Nicolas Grekas
8731a4fc0e bug #38358 [Messenger] Fix redis connection error message (alexander-schranz)
This PR was submitted for the 4.3 branch but it was merged into the 4.4 branch instead.

Discussion
----------

[Messenger] Fix redis connection error message

Use correct instance of redis to getLastError

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

The `$redis` is only set in the tests, the correct redis instance is available under `$this->connection`.

Reproduce: give a false `AUTH` to the redis:

Before:

> [Error]
>  Call to a member function getLastError() on null

Now:

>  [Symfony\Component\Messenger\Exception\InvalidArgumentException]
>  Redis connection failed: ERR Client sent AUTH, but no password is set

Commits
-------

f4e42ad3d4 Fix redis connection error message
2020-09-30 18:06:36 +02:00
Alexander Schranz
f4e42ad3d4 Fix redis connection error message
Use correct instance of redis to getLastError
2020-09-30 18:06:18 +02:00
Fabien Potencier
c4015edcfb bug #38343 Revert "bug #38063 [FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable" (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

Revert "bug #38063 [FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable"

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

As discussed in the linked issue, let's replace this with a recipe:
https://github.com/symfony/recipes/pull/825

TL;DR, these PRs replace `src/.preload.php` (generated) by `config/preload.php` (committed).

Commits
-------

662fcff40f Revert "bug #38063 [FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable (nicolas-grekas)"
2020-09-30 07:26:25 +02:00
Nicolas Grekas
662fcff40f Revert "bug #38063 [FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable (nicolas-grekas)"
This reverts commit d441d867cd, reversing
changes made to 043e7c34de.
2020-09-29 11:51:46 +02:00
Fabien Potencier
72ff4012a5 bug #38336 [PhpUnitBridge] Fixed class_alias() for PHPUnit\Framework\Error\Error (stevegrunwell)
This PR was merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] Fixed class_alias() for PHPUnit\Framework\Error\Error

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

PHPUnit 6.x removed the PHPUnit_Framework_* classes in favor of PHP namespaces, but one error class did not map the same as the others: `PHPUnit_Framework_Error`.

Instead of mapping to `PHPUnit\Framework\Error` in the same way that `PHPUnit_Framework_Error_Warning` mapped to `PHPUnit\Framework\Error\Warning`, this base class was replaced with `PHPUnit\Framework\Error\Error`, so we cannot map it using simple string replacement like its descendants.

Commits
-------

8e607b58df [PhpUnitBridge] Fix class_alias() for PHPUnit\Framework\Error\Error
2020-09-29 08:53:53 +02:00
Steve Grunwell
8e607b58df [PhpUnitBridge] Fix class_alias() for PHPUnit\Framework\Error\Error
PHPUnit 6.x removed the PHPUnit_Framework_* classes in favor of PHP namespaces, but one error class did not map the same as the others: `PHPUnit_Framework_Error`.

Instead of mapping to `PHPUnit\Framework\Error` in the same way that `PHPUnit_Framework_Error_Warning` mapped to `PHPUnit\Framework\Error\Warning`, this base class was replaced with `PHPUnit\Framework\Error\Error`.
2020-09-28 16:03:26 -04:00
Nicolas Grekas
cbb0b1d54b Merge branch '3.4' into 4.4
* 3.4:
  [HttpFoundation] skip tests when the IANA server is throttling the list of status codes
  [DoctrineBridge] fix DBAL v3 compat
2020-09-27 16:14:06 +02:00
Nicolas Grekas
feaa9a6b2a [HttpFoundation] skip tests when the IANA server is throttling the list of status codes 2020-09-27 16:13:16 +02:00
Nicolas Grekas
4b1612b8dd [DoctrineBridge] fix DBAL v3 compat 2020-09-27 16:06:58 +02:00
Nicolas Grekas
7529d131cc Merge branch '3.4' into 4.4
* 3.4:
  [Filesystem] fix for PHP 8
2020-09-27 15:54:16 +02:00
Nicolas Grekas
a4324447f1 [Filesystem] fix for PHP 8 2020-09-27 15:07:29 +02:00
Nicolas Grekas
911e120fa4 Merge branch '3.4' into 4.4
* 3.4:
  [Cache] fix DBAL v3 compat
  Bump Symfony version to 3.4.46
  Update VERSION for 3.4.45
  Update CONTRIBUTORS for 3.4.45
  Update CHANGELOG for 3.4.45
2020-09-27 14:40:39 +02:00
Nicolas Grekas
3d1ed2e90d [Cache] fix DBAL v3 compat 2020-09-27 14:33:10 +02:00
Fabien Potencier
08e27e9f03 Bump Symfony version to 4.4.15 2020-09-27 06:29:46 +02:00
Fabien Potencier
c589c9a604
Merge pull request #38312 from fabpot/release-4.4.14
released v4.4.14
2020-09-27 06:26:00 +02:00
Fabien Potencier
9e8f2e7db6 Update VERSION for 4.4.14 2020-09-27 06:25:44 +02:00
Fabien Potencier
5e81cb7c7b Update CHANGELOG for 4.4.14 2020-09-27 06:25:32 +02:00
Fabien Potencier
9a774ede48 Bump Symfony version to 3.4.46 2020-09-27 06:03:03 +02:00
Fabien Potencier
acaf962168
Merge pull request #38311 from fabpot/release-3.4.45
released v3.4.45
2020-09-27 05:47:15 +02:00
Fabien Potencier
bc38373380 Update VERSION for 3.4.45 2020-09-27 05:46:58 +02:00
Fabien Potencier
0022465b97 Update CONTRIBUTORS for 3.4.45 2020-09-27 05:46:54 +02:00
Fabien Potencier
17ceb6e73e Update CHANGELOG for 3.4.45 2020-09-27 05:46:13 +02:00
Fabien Potencier
55a450d827 Merge branch '3.4' into 4.4
* 3.4:
  update missing translations arabic
  [Yaml] simplify the test
  fix test by letting mock throw the actual expected exception
2020-09-27 05:36:23 +02:00
Nicolas Grekas
6bb0ef4f52 minor #38299 [ErrorHandler] Return false directly and remove unused variable (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] Return false directly and remove unused variable

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

To return true, $type and $log both need to be true. But to enter the condition, one of them has to be false.

I also spotted an unused variable below so I removed it.

Commits
-------

3933957d1a [ErrorHandler] Return false directly and remove unused variable
2020-09-25 11:42:25 +02:00
Thomas Calvet
3933957d1a [ErrorHandler] Return false directly and remove unused variable 2020-09-25 10:51:35 +02:00
Fabien Potencier
f71d8cfabb minor #38294 [OptionsResolver] Assert that the error type is valid in deprecations test (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[OptionsResolver] Assert that the error type is valid in deprecations test

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

A change in the code could cause a warning for example and still produce the expected number of errors and the expected last error. Checking the type of the error is a little bit better. The best would be to check all the expected deprecations one by one, maybe later? 😄

Commits
-------

926d18f2f9 [OptionsResolver] Assert that the error type is valid in deprecations test
2020-09-25 08:00:01 +02:00