Commit Graph

45269 Commits

Author SHA1 Message Date
Nicolas Grekas
15f08553be [OptionsResolve] Revert change in tests for a not-merged change in code 2019-10-28 18:16:45 +01:00
Nicolas Grekas
6d5c91bb47 Merge branch '3.4' into 4.3
* 3.4:
  #30432 fix an error message
  fix paths to detect code owners
  [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4
  Remove unused local variables in tests
  Make sure to collect child forms created on *_SET_DATA events
  do not render errors for checkboxes twice
2019-10-28 18:07:32 +01:00
Nicolas Grekas
48533ff3f1 bug #34152 [Workflow] Made the configuration more robust for the 'property' key (lyrixx)
This PR was merged into the 4.3 branch.

Discussion
----------

[Workflow] Made the configuration more robust for the 'property' key

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34092
| License       | MIT
| Doc PR        |

Commits
-------

0c31ff007e [Workflow] Made the configuration more robust for the 'property' key
2019-10-28 17:55:19 +01:00
Nicolas Grekas
fd5b8def49 bug #34154 [HttpClient] fix handling of 3xx with no Location header - ignore Content-Length when no body is expected (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] fix handling of 3xx with no Location header - ignore Content-Length when no body is expected

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

A `304` is the final response code.
This PR implements the same logic as curl.

Commits
-------

50a88c59f6 [HttpClient] fix handling of 3xx with no Location header - ignore Content-Length when no body is expected
2019-10-28 17:53:30 +01:00
Nicolas Grekas
50a88c59f6 [HttpClient] fix handling of 3xx with no Location header - ignore Content-Length when no body is expected 2019-10-28 16:45:56 +01:00
Massimiliano Arione
1dc7ce1159
add missing translation for 94 (it) 2019-10-28 16:39:28 +01:00
Ryan Weaver
38f19a960c Revert "[Messenger] Removing "sync" transport and replacing it with much nicer config trick"
This reverts commit 3d4e59a10b.
2019-10-28 11:14:08 -04:00
Grégoire Pineau
0c31ff007e [Workflow] Made the configuration more robust for the 'property' key 2019-10-28 15:45:57 +01:00
Robin Chalas
3be177a93f bug #34140 [Security/Core] make NativePasswordEncoder use sodium to validate passwords when possible (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Security/Core] make NativePasswordEncoder use sodium to validate passwords when possible

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

sodium implementations are always faster, let's use them when possible. This also allows validating argon2 passwords when bcrypt is configured as the main one, making migrations possible.

Commits
-------

799a2eae2d [Security/Core] make NativePasswordEncoder use sodium to validate passwords when possible
2019-10-28 10:35:50 +01:00
Nicolas Grekas
799a2eae2d [Security/Core] make NativePasswordEncoder use sodium to validate passwords when possible 2019-10-28 10:20:18 +01:00
Mathias Arlaud
f167c77eaf Handle non existent decorated services 2019-10-28 09:31:16 +01:00
Fabien Potencier
0472dbfccb bug #34145 [FrameworkBundle] make SodiumVault report bad decryption key accurately (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] make SodiumVault report bad decryption key accurately

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

Commits
-------

d9d16d2ce7 [FrameworkBundle] make SodiumVault report bad decryption key accurately
2019-10-27 18:49:11 +01:00
Nicolas Grekas
d9d16d2ce7 [FrameworkBundle] make SodiumVault report bad decryption key accurately 2019-10-27 17:21:30 +01:00
Jérémy Derussé
474daf976e
Allows URL DSN in Lock and Cache 2019-10-27 15:23:49 +01:00
Nicolas Grekas
0a1de38a5b cs fix 2019-10-27 13:36:05 +01:00
Nicolas Grekas
b5a47df0b9 feature #34020 [Security] Allow to stick to a specific password hashing algorithm (chalasr)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security] Allow to stick to a specific password hashing algorithm

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

Allows using `argon2i`, `argon2id` and `bcrypt`.

Commits
-------

6712d1e504 [Security] Allow to set a fixed algorithm
2019-10-27 13:33:51 +01:00
Robin Chalas
6712d1e504 [Security] Allow to set a fixed algorithm 2019-10-27 13:32:13 +01:00
Nicolas Grekas
60a4d8dc7a [Security/Core] make encodedLength computation more generic 2019-10-27 11:16:45 +01:00
Robin Chalas
32b227d004 minor #34138 [Security/Core] add fast path when encoded password cannot match anything (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security/Core] add fast path when encoded password cannot match anything

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

Only `MessageDigestPasswordEncoder` and `Pbkdf2PasswordEncoder` need this fast path: the sodium and the native encoders already implement it natively.

When a migrating encoder is used, a failed password validation fallbacks to all encoders. This makes the process slower than needed currently.

Commits
-------

c57f8f7f93 [Security/Core] add fast path when encoded password cannot match anything
2019-10-27 11:11:28 +01:00
Nicolas Grekas
c57f8f7f93 [Security/Core] add fast path when encoded password cannot match anything 2019-10-27 10:41:22 +01:00
Fabien Potencier
22230f7b8e feature #34131 [FrameworkBundle] Remove suffix convention when using env vars to override secrets from the vault (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Remove suffix convention when using env vars to override secrets from the vault

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

Right now, env vars that override encrypted secrets must en up with `_SECRET`.
This PR removes this convention. It also enforces that only vars defined in the vault can be overriden locally. This means one cannot set a local-only secret.

Commits
-------

2ec9647e75 [FrameworkBundle] Remove suffix convention when using env vars to override secrets from the vault
2019-10-27 09:05:59 +01:00
Robin Chalas
54e1d12f92 minor #34137 [Messenger] Fix redis test (chalasr)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] Fix redis test

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -
<!--
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/roadmap):
 - 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 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

3fdaf970c3 [Messenger] Fix redis test
2019-10-27 08:01:46 +01:00
Robin Chalas
3fdaf970c3 [Messenger] Fix redis test 2019-10-27 07:53:30 +01:00
Fabien Potencier
8920672b2e minor #34127 fix paths to detect code owners (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

fix paths to detect code owners

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

I was wondering why sometimes I didn't receive any notifications for PRs where I thought a file for which I claimed code ownership was modified. Turns out according to https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax the `dir/*` pattern does not include nested directories.

Commits
-------

cb7523d595 fix paths to detect code owners
2019-10-26 21:54:01 +02:00
Fabien Potencier
b54997d1df bug #34126 [VarDumper] fix infinite recursion (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[VarDumper] fix infinite recursion

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

Commits
-------

56d9f47857 [VarDumper] fix infinite recursion
2019-10-26 21:52:16 +02:00
Tobias Schultze
75c674debc [Messenger] fix retry of messages losing the routing key and properties 2019-10-26 20:28:54 +02:00
Nicolas Grekas
2ec9647e75 [FrameworkBundle] Remove suffix convention when using env vars to override secrets from the vault 2019-10-26 15:06:32 +02:00
Yonel Ceruto
fb70e0af8d minor #30442 [OptionsResolver] Fix an error message to be more accurate (dimabory)
This PR was merged into the 3.4 branch.

Discussion
----------

[OptionsResolver] Fix an error message to be more accurate

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #30432
| License       | MIT
| Doc PR        |

See #30432 for more details:
> **Symfony version(s) affected**: 3.4, maybe other versions too (not tested)
>
> **Description**
> Error message when allowedTypes is an array contains `[]` but should not:
> `The option "testme" with value array is expected to be of type "string[]", but one of the elements is of type "integer[]".`
> It should be:
> `The option "testme" with value array is expected to be of type "string[]", but one of the elements is of type "integer".`
>
> **How to reproduce**
>
> ```
> $resolver = (new OptionsResolver())
>     ->setDefault('testme', [])
>     ->setAllowedTypes('testme', ['string[]'])
>     ->resolve(['testme' => ['test', 12]]);
> ```

In addition I changed an error message to be more
accurate if provided more than one incorrect value:
> [...] is expected to be of type "integer[][]", but is of type "integer|boolean|string".

Commits
-------

7fa2fc2 #30432 fix an error message
2019-10-26 07:18:38 -04:00
Dmytro
7fa2fc2b96 #30432 fix an error message 2019-10-26 07:02:01 -04:00
Thomas Calvet
6cbee0944c [FrameworkBundle][Translation] Invalidate cached catalogues when the scanned directories change 2019-10-26 12:43:57 +02:00
Yonel Ceruto
2a5c75582e bug #33999 [Form] Make sure to collect child forms created on *_SET_DATA events (yceruto)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] Make sure to collect child forms created on *_SET_DATA events

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

See reproducer provided by @WubbleWobble https://github.com/WubbleWobble/symfony-issue-29291.

Commits
-------

50efc1a Make sure to collect child forms created on *_SET_DATA events
2019-10-26 06:32:38 -04:00
Fabien Potencier
8eb17aa203 bug #34076 [HttpKernel] Avoid nested exceptions if errors occur when generating file links (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] Avoid nested exceptions if errors occur when generating file links

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

Multiple exceptions are fired until the fallback error page is rendered without the FileLinkFormatter:
48282ce80f/src/Symfony/Component/HttpKernel/Debug/FileLinkFormatter.php (L79-L86)

**Before** (the reproducer is highlighted inside the picture or simply adds an undefined option to the `@Route()` annotation)
![error-page-before](https://user-images.githubusercontent.com/2028198/67356903-c8a17700-f529-11e9-9384-12a29e17b682.png)

**After** (I couldn't find a better solution to display this exception once)
![error-page-after](https://user-images.githubusercontent.com/2028198/67356941-db1bb080-f529-11e9-8808-d7f72dadc4d6.png)

Commits
-------

d91a5a067d Avoid nested exceptions if errors occur when generating file links
2019-10-26 10:25:48 +02:00
Christian Flothmann
cb7523d595 fix paths to detect code owners 2019-10-26 10:25:32 +02:00
Nicolas Grekas
56d9f47857 [VarDumper] fix infinite recursion 2019-10-26 10:24:21 +02:00
Fabien Potencier
591ad2203c bug #34090 [WebProfilerBundle] Improve display in Email panel for dark theme (antograssiot)
This PR was merged into the 4.3 branch.

Discussion
----------

[WebProfilerBundle] Improve display in Email panel for dark theme

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

Improve the email panel readability when using dark theme

## before
<img width="496" alt="Capture d’écran 2019-10-23 à 19 54 59" src="https://user-images.githubusercontent.com/4977112/67420667-5d11e500-f5cf-11e9-91c6-75d2f55a32e7.png">

## after
<img width="492" alt="Capture d’écran 2019-10-23 à 19 53 26" src="https://user-images.githubusercontent.com/4977112/67420679-626f2f80-f5cf-11e9-8762-ad56978c1ac8.png">

Commits
-------

402fed02e7 [WebProfilerBundle] Improve display in Email panel for dark theme
2019-10-26 10:23:07 +02:00
Fabien Potencier
a73341b0f6 bug #34124 [HttpKernel] (Welcome Page) Fix web debug toolbar z-index property (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] (Welcome Page) Fix web debug toolbar z-index property

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

Commits
-------

f7a242d705 Fix web debug toolbar z-index property
2019-10-26 10:22:14 +02:00
Christian Flothmann
ccc5667df8 minor #34100 [Yaml][Parser] Remove the getLastLineNumberBeforeDeprecation() internal unused method (fancyweb)
This PR was merged into the 4.3 branch.

Discussion
----------

[Yaml][Parser] Remove the getLastLineNumberBeforeDeprecation() internal unused method

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

This method is internal and unused. It was removed by a2ae6bf745 but was added back mistakenly by 1baac5a74f.

Commits
-------

49acc16424 [Yaml][Parser] Remove the getLastLineNumberBeforeDeprecation() internal unused method
2019-10-26 09:13:46 +02:00
Christian Flothmann
48d189b46b minor #34112 [SecurityBundle] Fix wrong assertion (chalasr)
This PR was merged into the 4.3 branch.

Discussion
----------

[SecurityBundle] Fix wrong assertion

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

Commits
-------

8e56f46150 [SecurityBundle] Fix wrong assertion
2019-10-26 09:11:52 +02:00
Yonel Ceruto
f7a242d705 Fix web debug toolbar z-index property 2019-10-25 20:47:58 -04:00
Tobias Schultze
0e3bae28ec remove experimental added in 4.3 as bugfix 2019-10-25 15:44:38 +02:00
Tobias Schultze
c950130fc2 Merge branch '4.3' into 4.4 2019-10-25 15:41:20 +02:00
Fabien Potencier
6c08ac599e bug #34116 [HttpClient] ignore the body of responses to HEAD requests (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] ignore the body of responses to HEAD requests

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

Commits
-------

0fc371e7df [HttpClient] ignore the body of responses to HEAD requests
2019-10-25 15:21:40 +02:00
Nicolas Grekas
0fc371e7df [HttpClient] ignore the body of responses to HEAD requests 2019-10-25 15:08:37 +02:00
Tobias Schultze
c953ba88d7 minor #34097 [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4 (alexpott)
This PR was squashed before being merged into the 3.4 branch (closes #34097).

Discussion
----------

[Validator] Ensure numeric subpaths do not cause errors on PHP 7.4

| 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       | Fix #... <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Drupal is testing on PHP7.4 and hitting a problem with the line `if ('[' === $subPath[0]) {` because `$subPath` is not a string. We're already doing string casting in the method so we could do it once and be done. Note this is not a problem on the master branch / SF5 because of primitive typehinting.

Without this fix on PHP7.4 you see errors like...
```
1) Symfony\Component\Validator\Tests\Util\PropertyPathTest::testAppend with data set #5 ('0', 1, '0.1', 'Numeric subpaths do not cause...rrors.')
Trying to access array offset on value of type int
```

Commits
-------

6244a1ec47 [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4
2019-10-25 15:07:00 +02:00
Alex Pott
6244a1ec47 [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4 2019-10-25 15:06:49 +02:00
Tobias Schultze
4d8a01e0f2 minor #34110 [Messenger] remove infinite (nullable) max retries (Tobion)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] remove infinite (nullable) max retries

| 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       | Fix #33284
| License       | MIT
| Doc PR        |

Infinite retries are useless and putting a high enough number is more self-explaining. Infinite retries could not be configured using the framework anyway, see issue.

Commits
-------

4a6ec8554e [Messenger] remove nullable max retries
2019-10-25 15:05:23 +02:00
Tobias Schultze
8bf8c50363 bug #32456 [Messenger] use database platform to convert correctly the DateTime (roukmoute)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] use database platform to convert correctly the DateTime

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/32427
| License       | MIT

In Doctrine Messenger the method `\Symfony\Component\Messenger\Transport\Doctrine\Connection::formatDateTime()` is used to format dateTime into this: `Y-m-d\TH:i:s`.
But this is not supported in all databases platform.

Here we use the database platform to convert correctly the dateTime.

Commits
-------

cfa11561d1 Format DateTime depending on database platform
2019-10-25 12:57:14 +02:00
Tobias Schultze
13853d575d bug #34107 [Messenger] prevent infinite redelivery loops and blocked queues (Tobion)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] prevent infinite redelivery loops and blocked queues

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

This PR solves a very common fitfall of amqp redeliveries. It's for example explained in https://blog.forma-pro.com/rabbitmq-redelivery-pitfalls-440e0347f4e0
Newer RabbitMQ versions provide a solution for this by itself but only for quorum queues and not the classic ones, see https://github.com/rabbitmq/rabbitmq-server/pull/1889

This PR adds a middleware that throws a RejectRedeliveredMessageException when a message is detected that has been redelivered by AMQP.

The middleware runs before the HandleMessageMiddleware and prevents redelivered messages from being handled directly. The thrown exception is caught by the worker and will trigger the retry logic according to the retry strategy.

AMQP redelivers messages when they do not get acknowledged or rejected. This can happen when the connection times out or an exception is thrown before acknowledging or rejecting. When such errors happen again while handling the redelivered message, the message would get redelivered again and again. The purpose of this middleware is to prevent infinite redelivery loops and to unblock the queue by republishing the redelivered messages as retries with a retry limit and potential delay.

Commits
-------

d211904c8e [Messenger] prevent infinite redelivery loops and blocked queues
2019-10-25 12:52:06 +02:00
Robin Chalas
8e56f46150 [SecurityBundle] Fix wrong assertion 2019-10-25 10:35:42 +02:00
Mathias STRASSER
cfa11561d1
Format DateTime depending on database platform 2019-10-25 10:13:54 +02:00