Commit Graph

49159 Commits

Author SHA1 Message Date
Fabien Potencier
e778ea6367 bug #37022 [DependencyInjection] Improve missing package/version deprecation (acrobat)
This PR was merged into the 5.1 branch.

Discussion
----------

[DependencyInjection] Improve missing package/version deprecation

| Q             | A
| ------------- | ---
| Branch?       | 5.1
| 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        |

After updating to symfony 5.1 I've got some deprecations related to the missing package/version attributes/options for `deprecated` on services.

But currently it's not clear which bundle/part of the code is triggering the deprecations. The only way for me to track down where they were coming from was by setting a xdebug breakpoint in the `XmlFileLoader` and check the `$file` variable.

So it seemed like a good idea to include the file path in the deprecation message, that way it will be easier for users to know if their code or a bundle (and which) is triggering this deprecation.

Before:
<img width="871" alt="Screenshot 2020-05-31 at 13 51 03" src="https://user-images.githubusercontent.com/1374857/83351609-d0d65600-a345-11ea-9785-3237a3ec2360.png">

After:
<img width="907" alt="Screenshot 2020-05-31 at 13 50 10" src="https://user-images.githubusercontent.com/1374857/83351606-cfa52900-a345-11ea-9617-60d07e46234b.png">

Commits
-------

f603317363 [DependencyInjection] Improve missing package/version deprecation
2020-06-03 10:14:01 +02:00
Fabien Potencier
773b4ef382 bug #37038 Fix invalid char in SQS Headers (jderusse)
This PR was squashed before being merged into the 5.1 branch.

Discussion
----------

Fix invalid char in SQS Headers

| Q             | A
| ------------- | ---
| Branch?       | 5.1
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | yes
| Tickets       | https://github.com/symfony/symfony/pull/36525#issuecomment-636658635
| License       | MIT
| Doc PR        | /

From [Amazon documnetation](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-attributes.html) header's name have constraints:
- only `a-zA-Z0-9_\.-` + not start/end with a `.`
- 256 char

This PR serialize ALL headers in a single SQS Attribute.

Commits
-------

76a18b0b47 Fix invalid char in SQS Headers
2020-06-03 10:07:24 +02:00
Jérémy Derussé
76a18b0b47 Fix invalid char in SQS Headers 2020-06-03 10:07:11 +02:00
Fabien Potencier
d34125436b bug #37047 [SecurityBundle] Only register CSRF protection listener if CSRF is available (wouterj)
This PR was merged into the 5.1 branch.

Discussion
----------

[SecurityBundle] Only register CSRF protection listener if CSRF is available

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

I know we're not allowed to add new deprecations in already released versions. However, I don't think anyone is using SecurityBundle's compiler passes except from Symfony itself - so I don't think anyone is affected by this deprecation. The alternatives would be:

* Add a new compiler pass in 5.1 that conditionally registers the CSRF listener
* Do this exact change in 5.2 and...
  * accept a `null` argument in the listener for 5.1
  * or add this to the `RegisterCsrfTokenClearingLogoutHandlerPass` class in 5.1

Commits
-------

2d738b30de Only register CSRF protection listener if CSRF is available
2020-06-03 10:04:58 +02:00
Fabien Potencier
2a9edfadd8 bug #37058 [FrameworkBundle] Extension Serializer issue (Korbeil)
This PR was merged into the 5.1 branch.

Discussion
----------

[FrameworkBundle] Extension Serializer issue

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

Hi,

When creating a new Symfony project and requiring `symfony/serializer` we have an issue with required service.

Here is a simple reproducer:
![image](https://user-images.githubusercontent.com/944409/83497176-6266d480-a4ba-11ea-98cb-7e354be0a273.png)

This bug was introduced by https://github.com/symfony/symfony/pull/31390

Commits
-------

ab5628f0f4 FrameworkBundle Serializer issue
2020-06-03 09:58:46 +02:00
Fabien Potencier
706ff581fb bug #37056 [DoctrineBridge] register event listeners depending on the installed packages (xabbuh)
This PR was merged into the 5.1 branch.

Discussion
----------

[DoctrineBridge] register event listeners depending on the installed packages

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

Commits
-------

f61b0097f4 register event listeners depending on the installed packages
2020-06-02 10:47:59 +02:00
Fabien Potencier
ab3772a94e bug #37020 [ExpressionLanguage] reset the internal state when the parser is finished (xabbuh)
This PR was merged into the 5.1 branch.

Discussion
----------

[ExpressionLanguage] reset the internal state when the parser is finished

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

Commits
-------

d58eb020d0 reset the internal state when the parser is finished
2020-06-02 10:46:57 +02:00
Fabien Potencier
73fed65d16 Fix CS 2020-06-02 10:42:14 +02:00
Fabien Potencier
2234a70621 minor #37057 [Validator] simplify the tests (xabbuh)
This PR was merged into the 5.1 branch.

Discussion
----------

[Validator] simplify the tests

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

Commits
-------

cfc6fc8527 simplify the tests
2020-06-02 10:41:45 +02:00
Baptiste Leduc
ab5628f0f4
FrameworkBundle Serializer issue 2020-06-02 10:26:46 +02:00
Christian Flothmann
f61b0097f4 register event listeners depending on the installed packages 2020-06-02 09:33:01 +02:00
Wouter de Jong
2d738b30de Only register CSRF protection listener if CSRF is available 2020-06-01 18:29:48 +02:00
Fabien Potencier
e5b5d9ea14 bug #37031 [Security] Fixed PUBLIC_ACCESS in authenticated sessions (wouterj)
This PR was merged into the 5.1 branch.

Discussion
----------

[Security] Fixed PUBLIC_ACCESS in authenticated sessions

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

Found while testing https://github.com/scheb/2fa/pull/8, sorry for not spotting it before the stable release 😞

Currently, authenticated users are denied access for pages that have `PUBLIC_ACCESS` set, as this attribute is only checked when no token was set. It should be checked for both cases.

Commits
-------

0ac530f460 Also check PUBLIC_ACCESS for authenticated tokens
2020-06-01 07:24:47 +02:00
Fabien Potencier
1696f56398 bug #37028 [FrameworkBundle] Fix enabled_locales behavior (tgalopin)
This PR was merged into the 5.1 branch.

Discussion
----------

[FrameworkBundle] Fix enabled_locales behavior

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

I was experimenting with enabled_locales on my application and I noticed the cache didn't actually change. It seems the generated service definition was invalid: the file `var/cache/dev/ContainerFEQLy1x/App_KernelDevDebugContainer.php` defined `getTranslator_DefaultService` by calling `new Translator` with 7 arguments instead of 6.

It seems to be due to the fact that the DI extension does not replace the right argument. With the following fix applied the behavior works as expected.

However, reading the comment of Javier in https://github.com/symfony/symfony/pull/32433, it seems he tested it against Demo and it worked with the previous code. I'm not sure why, @javiereguiluz I'd be interested in knowing if I'm missing something here :) .

Commits
-------

e2ce7f5030 Fix enabled_locales behavior
2020-06-01 07:21:50 +02:00
Wouter de Jong
0ac530f460 Also check PUBLIC_ACCESS for authenticated tokens
Currently, authenticated users are denied access for pages that have
PUBLIC_ACCESS, as this attribute is only checked when no token was set.
2020-05-31 23:41:52 +02:00
Titouan Galopin
e2ce7f5030 Fix enabled_locales behavior 2020-05-31 21:55:44 +02:00
Jeroen Thora
f603317363
[DependencyInjection] Improve missing package/version deprecation 2020-05-31 13:36:45 +02:00
Christian Flothmann
d58eb020d0 reset the internal state when the parser is finished 2020-05-31 09:33:39 +02:00
Christian Flothmann
cfc6fc8527 simplify the tests 2020-05-31 09:21:25 +02:00
Fabien Potencier
2af156d6fe bumped Symfony version to 5.1.1 2020-05-31 08:17:42 +02:00
Fabien Potencier
729e21c653
Merge pull request #37019 from fabpot/release-5.1.0
released v5.1.0
2020-05-31 08:14:54 +02:00
Fabien Potencier
70780fc68b updated VERSION for 5.1.0 2020-05-31 08:14:18 +02:00
Fabien Potencier
69f45dc3a2 updated CHANGELOG for 5.1.0 2020-05-31 08:14:11 +02:00
Nicolas Grekas
af444f8aaf bug #37009 [Validator] use "allowedVariables" to configure the ExpressionLanguageSyntax constraint (xabbuh)
This PR was merged into the 5.1 branch.

Discussion
----------

[Validator] use "allowedVariables" to configure the ExpressionLanguageSyntax constraint

| Q             | A
| ------------- | ---
| Branch?       | 5.1
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix symfony/symfony-docs#13669
| License       | MIT
| Doc PR        |

Commits
-------

4807dab305 [Validator] use "allowedVariables" to configure the ExpressionLanguageSyntax constraint
2020-05-30 23:58:16 +02:00
Christian Flothmann
4807dab305 [Validator] use "allowedVariables" to configure the ExpressionLanguageSyntax constraint 2020-05-30 23:56:41 +02:00
Nicolas Grekas
3e05f1dafe Merge branch '5.0' into 5.1
* 5.0:
  [Security] Fixed AbstractToken::hasUserChanged()
  [DI] fix typo
2020-05-30 23:52:37 +02:00
Nicolas Grekas
41b95952d3 Merge branch '4.4' into 5.0
* 4.4:
  [Security] Fixed AbstractToken::hasUserChanged()
  [DI] fix typo
2020-05-30 23:52:15 +02:00
Nicolas Grekas
bdb01db3dc bug #37008 [Security] Fixed AbstractToken::hasUserChanged() (wouterj)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Security] Fixed AbstractToken::hasUserChanged()

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

This PR completely reverts #35944.

That PR tried to fix a BC break (ref #35941, #35509) introduced by #31177. However, this broke many authentications (ref #36989), as the User is serialized in the session (as hinted by @stof). Many applications don't include the `roles` property in the serialization (at least, the MakerBundle doesn't include it).

In 5.2, we should probably deprecate having different roles in token and user, which fixes the BC breaks all together.

Commits
-------

f297beb42c [Security] Fixed AbstractToken::hasUserChanged()
2020-05-30 23:50:18 +02:00
Wouter de Jong
f297beb42c [Security] Fixed AbstractToken::hasUserChanged() 2020-05-30 23:50:11 +02:00
Nicolas Grekas
d9506ab843 Merge branch '3.4' into 4.4
* 3.4:
  [DI] fix typo
2020-05-30 23:49:23 +02:00
Nicolas Grekas
308f28678c [PropertyAccess] fix merge 2020-05-30 23:17:32 +02:00
Nicolas Grekas
fa31260e5e [DI] fix typo 2020-05-30 23:06:01 +02:00
Nicolas Grekas
51da6239ba Merge branch '5.0' into 5.1
* 5.0:
  Fix abstract method name in PHP doc block
  Various cleanups
  [HttpClient] fix issues in tests
  Fixes sprintf(): Too few arguments in form transformer
  [Console] Fix QuestionHelper::disableStty()
  [Validator] Use Mime component to determine mime type for file validator
  validate subforms in all validation groups
  Update Hungarian translations
  Add meaningful message when Process is not installed (ProcessHelper)
  [PropertyAccess] Fix TypeError parsing again.
  [TwigBridge] fix fallback html-to-txt body converter
  [Security/Http] fix merge
  [ErrorHandler] fix setting $trace to null in FatalError
  [Form] add missing Czech validators translation
  [Validator] add missing Czech translations
  never directly validate Existence (Required/Optional) constraints
2020-05-30 22:35:19 +02:00
Nicolas Grekas
527f3f305e Merge branch '4.4' into 5.0
* 4.4:
  Fix abstract method name in PHP doc block
  Various cleanups
  [HttpClient] fix issues in tests
  Fixes sprintf(): Too few arguments in form transformer
  [Console] Fix QuestionHelper::disableStty()
  [Validator] Use Mime component to determine mime type for file validator
  validate subforms in all validation groups
  Update Hungarian translations
  Add meaningful message when Process is not installed (ProcessHelper)
  [PropertyAccess] Fix TypeError parsing again.
  [TwigBridge] fix fallback html-to-txt body converter
  [Form] add missing Czech validators translation
  [Validator] add missing Czech translations
  never directly validate Existence (Required/Optional) constraints
2020-05-30 22:12:43 +02:00
Nicolas Grekas
143718c750 Merge branch '3.4' into 4.4
* 3.4:
  Fix abstract method name in PHP doc block
2020-05-30 22:07:26 +02:00
Nicolas Grekas
79f80d361c minor #37015 Fix abstract method name in PHP doc block (l-vo)
This PR was merged into the 3.4 branch.

Discussion
----------

Fix abstract method name in PHP doc block

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

Commits
-------

d6966c3147 Fix abstract method name in PHP doc block
2020-05-30 22:07:07 +02:00
Nicolas Grekas
282cafb093 Merge branch '3.4' into 4.4
* 3.4:
  Various cleanups
2020-05-30 22:06:45 +02:00
Laurent VOULLEMIER
d6966c3147
Fix abstract method name in PHP doc block 2020-05-30 21:50:06 +02:00
Nicolas Grekas
d8f282edca Various cleanups 2020-05-30 20:58:05 +02:00
Nicolas Grekas
255e9117a0 Merge branch '3.4' into 4.4
* 3.4:
  Fixes sprintf(): Too few arguments in form transformer
  [Console] Fix QuestionHelper::disableStty()
  validate subforms in all validation groups
  Update Hungarian translations
  Add meaningful message when Process is not installed (ProcessHelper)
  [PropertyAccess] Fix TypeError parsing again.
  [Form] add missing Czech validators translation
  [Validator] add missing Czech translations
  never directly validate Existence (Required/Optional) constraints
2020-05-30 20:50:54 +02:00
Nicolas Grekas
84081adbf7 bug #36894 [Validator] never directly validate Existence (Required/Optional) constraints (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] never directly validate Existence (Required/Optional) constraints

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

Using `Optional` or `Required` like "regular" constraints does not make any sense, but doing so didn't break before #36365. I suggest to ignore them for now and deprecate using them outside the `Collection` constraint in 5.2.

Commits
-------

d333aae187 never directly validate Existence (Required/Optional) constraints
2020-05-30 20:43:38 +02:00
Nicolas Grekas
8e40814164 bug #37007 [Console] Fix QuestionHelper::disableStty() (chalasr)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console] Fix QuestionHelper::disableStty()

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

We broke it when adding `Terminal::hasSttyAvailable()`.
Let's fix it on 3.4 and move it to terminal on master, as suggested in #36977

Commits
-------

5d93b61278 [Console] Fix QuestionHelper::disableStty()
2020-05-30 20:43:03 +02:00
Nicolas Grekas
ca66e6cede minor #37003 [PropertyAccess] Fix TypeError parsing again (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[PropertyAccess] Fix TypeError parsing again

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

Apparently, the format of `TypeError`s has changed again in php8. While investigating, I noticed our error message parsing is not handling anonymous classes well, so I've added some test cases for them.

I chose a fuzzier regular expression to parse the expected return type from the error message. Additionally, I'm checking the stack trace if the caught `TypeError` is really caused by the accessor call.

Commits
-------

03b4e98630 [PropertyAccess] Fix TypeError parsing again.
2020-05-30 20:42:19 +02:00
Nicolas Grekas
2e8ae40183 bug #36865 [Form] validate subforms in all validation groups (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] validate subforms in all validation groups

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

Commits
-------

b819d94d14 validate subforms in all validation groups
2020-05-30 20:41:29 +02:00
Nicolas Grekas
e8beef468b bug #36907 Fixes sprintf(): Too few arguments in form transformer (pedrocasado)
This PR was merged into the 3.4 branch.

Discussion
----------

Fixes sprintf(): Too few arguments in form transformer

Similar to: #29482

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

Fixes the form reverse transformation when the method viewToNorm is called within a value with the character %:

Before : "sprintf(): Too few arguments"

After : Form reverse transformation works.

Reference : http://php.net/manual/function.sprintf.php

Commits
-------

ff7d3f4f01 Fixes sprintf(): Too few arguments in form transformer
2020-05-30 20:40:39 +02:00
Nicolas Grekas
68d14c8511 minor #37013 [HttpClient] fix issues in tests (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] fix issues in tests

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

Commits
-------

a337ba5547 [HttpClient] fix issues in tests
2020-05-30 20:39:29 +02:00
Nicolas Grekas
a337ba5547 [HttpClient] fix issues in tests 2020-05-30 20:33:03 +02:00
Pedro Casado
ff7d3f4f01 Fixes sprintf(): Too few arguments in form transformer 2020-05-30 19:48:24 +02:00
Fabien Potencier
5e0e9a8019 bug #36868 [Validator] Use Mime component to determine mime type for file validator (pierredup)
This PR was merged into the 4.4 branch.

Discussion
----------

[Validator] Use Mime component to determine mime type for file validator

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

When validating the mime type for a file, the Validator component relies on the `Symfony\Component\HttpFoundation\File\File` class, but if the HttpFoundation component is not installed, then you just get the error

```
PHP Fatal error:  Uncaught Error: Class 'Symfony\Component\HttpFoundation\File\File' not found
```

This PR uses the Mime component to get the mime type for a file and throws an exception if the Mime component is not installed.

Commits
-------

472883313f [Validator] Use Mime component to determine mime type for file validator
2020-05-30 09:26:56 +02:00
Fabien Potencier
a3c460fdcb minor #37004 [Form] Update Hungarian translations (1ed)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] Update Hungarian translations

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

1614595424 Update Hungarian translations
2020-05-30 09:18:49 +02:00