Commit Graph

38475 Commits

Author SHA1 Message Date
Nicolas Grekas
e69673562c [VarDumper] fix for change in PHP 7.4.6 (bis) 2020-05-16 12:04:57 +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
Christian Flothmann
507a5963e4 embed resource name in error message 2020-05-15 09:32:03 +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
Nicolas Grekas
44b45cbaf1 [Serializer] fix issue with PHP 8 2020-05-12 22:34:06 +02: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
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
02b378f248 [3.4] CS fixes 2020-05-08 12:38:31 +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
Nicolas Grekas
94482fe1be minor #36726 [FrameworkBundle] display actual target for error in AssetsInstallCommand (NerdyProjects)
This PR was submitted for the 4.4 branch but it was merged into the 3.4 branch instead.

Discussion
----------

[FrameworkBundle] display actual target for error in AssetsInstallCommand

| 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

When assets:install fails because the target directory does not exist, it should display the actual directory it wanted to have instead of the configuration directive. In most cases, the target directory is retrieved from the kernel config and thus differs from the argument.

Commits
-------

f177b3d488 [FrameworkBundle] display actual target for error in AssetsInstallCommand
2020-05-08 11:56:21 +02:00
Matthias Larisch
f177b3d488 [FrameworkBundle] display actual target for error in AssetsInstallCommand
When assets:install fails because the target directory does not exist, it should display the actual directory it wanted to have instead of the configuration directive. In most cases, the target directory is retrieved from the kernel config and thus differs from the argument.
2020-05-08 11:56:06 +02:00
Nicolas Grekas
9b088bb014 minor #36744 Remove patches for Doctrine bugs and deprecations (greg0ire)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

Remove patches for Doctrine bugs and deprecations

| 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

This PR removes patches put in place because of a bug fixed in doctrine/dbal#3994, and because of deprecations addressed in doctrine/orm#7953

Commits
-------

2f305cdc83 Remove patches for Doctrine bugs and deprecations
2020-05-08 11:45:19 +02:00
Grégoire Paris
2f305cdc83 Remove patches for Doctrine bugs and deprecations 2020-05-08 11:45:13 +02:00
Gocha Ossinkine
2e99caacaf [Yaml] Fix escaped quotes in quoted multi-line string 2020-05-07 22:33:48 +05:00
Matthias Derer
88e43d4d4c [DI][EventDispatcher] added contract for implementation
fixes #36708.
2020-05-05 17:06:23 +02:00
Nicolas Grekas
a8b5b15c25 minor #36707 Force doctrine/dbal <=2.10.2 when testing (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

Force doctrine/dbal <=2.10.2 when testing

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

Until https://github.com/doctrine/dbal/issues/3990 is resolved.

Commits
-------

d1953d61cd Force doctrine/dbal <=2.10.2 when testing
2020-05-05 15:52:00 +02:00
Nicolas Grekas
d1953d61cd Force doctrine/dbal <=2.10.2 when testing 2020-05-05 15:43:18 +02:00
Nicolas Grekas
f7fc3cf6cb [PhpUnitBridge] fix PHP 5.3 compat 2020-05-05 09:38:03 +02:00
Fabien Potencier
9b8911598b bug #36569 [PhpUnitBridge] Mark parent class also covered in CoverageListener (lyrixx)
This PR was merged into the 3.4 branch.

Discussion
----------

[PhpUnitBridge] Mark parent class also covered in CoverageListener

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

Commits
-------

dcb5653728 [PhpUnitBridge] Mark parent class also covered in CoverageListener
2020-05-05 07:34:36 +02:00
Fabien Potencier
6340e87755 bug #36690 [Yaml] prevent notice for invalid octal numbers on PHP 7.4 (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Yaml] prevent notice for invalid octal numbers on PHP 7.4

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

Commits
-------

92bc19fd0c prevent notice for invalid octal numbers on PHP 7.4
2020-05-05 07:30:40 +02:00
Grégoire Pineau
dcb5653728 [PhpUnitBridge] Mark parent class also covered in CoverageListener 2020-05-05 00:33:45 +02:00
Christian Flothmann
92bc19fd0c prevent notice for invalid octal numbers on PHP 7.4 2020-05-04 18:58:31 +02:00
Nicolas Grekas
cfa048c804 minor #36684 Fix exception messages containing exception messages (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

Fix exception messages containing exception messages

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

Commits
-------

169e49d491 Fix exception messages containing exception messages
2020-05-04 17:20:19 +02:00
Nicolas Grekas
169e49d491 Fix exception messages containing exception messages 2020-05-04 17:12:51 +02:00
Nicolas Grekas
bd952b9c47 bug #36497 [Filesystem] Handle paths on different drives (crishoj)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Filesystem] Handle paths on different drives

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

`makePathRelative` strips and ignores the drive letters given Windows paths on different drives, resulting in a relative path which does not resolve to the desired target.

This PR makes `makePathRelative` notice paths on different drives, and return the full (absolute) target path in case instead.

Commits
-------

00e727ae4e [Filesystem] Handle paths on different drives
2020-05-04 15:48:43 +02:00
Christian Rishøj
00e727ae4e [Filesystem] Handle paths on different drives 2020-05-04 15:48:34 +02:00
Nicolas Grekas
cf0d086d14 bug #36678 [WebProfiler] Do not add src-elem CSP directives if they do not exist (ndench)
This PR was merged into the 3.4 branch.

Discussion
----------

[WebProfiler] Do not add src-elem CSP directives if they do not exist

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

In the latest 3.4.*, 4.4.* and 5.0.* branches the `script-src-elem` and `style-src-elem` directives are added to the Content-Security-Policy header if they don't exist by copying the `default-src`. This causes browsers to ignore the `script-src` and `style-src` directives which likely contain scripts and styles the developer wanted to allow.

As mentioned in the fixed ticket, we shouldn't be adding these directives if they don't exist because the browser will automatically fallback to `script-src` and `style-src` which we have already added `unsafe-inlen` and the `nonce-*` to.

This will need to be merged into 3.4, 4.4 and 5.0, but I was unsure which branch I am meant to base it off to start with. I've put it on 4.4 but can move it to another if required.

Commits
-------

d9c47087c9 [WebProfiler] Do not add src-elem CSP directives if they do not exist
2020-05-04 15:33:45 +02:00
Nicolas Grekas
78a7f4682f bug #36501 [DX] Show the ParseException message in all YAML file loaders (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[DX] Show the ParseException message in all YAML file loaders

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

This PR synchronizes the exception message in the Routing, Validator and Translation YAML file loaders with the DependencyInjection YAML file loader behavior. Adding the ParseException message is a big DX gain because it highlights the problem directly instead of having to scroll down 7 previous exceptions.

I'm targetting 3.4 because DX can be considered as a bug fix AFAIK.

Commits
-------

fc6cf3d3c6 [DX] Show the ParseException message in YAML file loaders
2020-05-04 15:29:28 +02:00
Nathan Dench
d9c47087c9 [WebProfiler] Do not add src-elem CSP directives if they do not exist 2020-05-04 15:18:19 +02:00
Fabien Potencier
bb77914a26 bug #36683 [Yaml] fix parse error when unindented collections contain a comment (wdiesveld)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Yaml] fix parse error when unindented collections contain a comment

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

### Problem
The method `Parser::getNextEmbedBlock` did not determine the yaml-block correctly when there was a comment before the first unindented collection item. This was caused by the fact that the check for unindented collection items was done for the _first line of the block only_. So in case this first line is a comment, this check will result in _false_, while in fact the parser is in an unindented collection.

### Solution
In the solution I implemented the parser will check for comment lines as well. As long as the loop encounters a comment line, it will check (in the next iteration) whether the line is an unindented collection item. So this check will be done until all comments before the first uncommented item are parsed.

Commits
-------

58bb2c52ac [Yaml] fix parse error when unindented collections contain a comment
2020-05-04 14:50:49 +02:00
Wouter Diesveld
58bb2c52ac [Yaml] fix parse error when unindented collections contain a comment 2020-05-04 14:50:41 +02:00
Fabien Potencier
469d82d6e2 bug #36672 [Validator] Skip validation when email is an empty object (acrobat)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Skip validation when email is an empty object

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

When the value passed to the email validator is an empty object the validator is still called and will mark the value as invalid. The object should be skipped in this case, as it is also done in the `UrlValidator`

bfdbb244fe/src/Symfony/Component/Validator/Constraints/UrlValidator.php (L59-L62)

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

de5d68ef2a Skip validation when email is an empty object
2020-05-04 09:50:33 +02:00
Fabien Potencier
e3d2a50c35 minor #36680 [3.4][Inflector] Improve testSingularize() argument name (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[3.4][Inflector] Improve testSingularize() argument name

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/pull/36639#discussion_r418192900
| License       | MIT
| Doc PR        | -

Follow up of https://github.com/symfony/symfony/pull/36639 on 3.4 to keep both tests methods synchronized.

Commits
-------

75405247be [3.4][Inflector] Improve testSingularize() argument name
2020-05-04 09:44:57 +02:00
Thomas Calvet
75405247be [3.4][Inflector] Improve testSingularize() argument name 2020-05-04 09:08:14 +02:00
Nicolas Grekas
119b81035b bug #36673 [PhpUnitBridge] fix PHP 5.3 compat again (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[PhpUnitBridge] fix PHP 5.3 compat again

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

Commits
-------

065a8cee5f [PhpUnitBridge] fix PHP 5.3 compat again
2020-05-03 23:54:48 +02:00
Nicolas Grekas
065a8cee5f [PhpUnitBridge] fix PHP 5.3 compat again 2020-05-03 23:44:38 +02:00
Jeroen Thora
de5d68ef2a
Skip validation when email is an empty object 2020-05-03 21:36:20 +02:00
Fabien Potencier
bfdbb244fe minor #36667 fix sr_Latn translation (kaznovac)
This PR was merged into the 3.4 branch.

Discussion
----------

fix sr_Latn translation

*negative* translated as positive

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

Commits
-------

0da177a224 fix sr_Latn translation
2020-05-03 08:32:27 +02:00
Marko Kaznovac
0da177a224
fix sr_Latn translation
*negative* translated as positive
2020-05-03 00:06:24 +02:00
Christian Flothmann
aee10cd44a bug #36627 [Validator] fix lazy property usage. (bendavies)
This PR was squashed before being merged into the 3.4 branch (closes #36627).

Discussion
----------

[Validator] fix lazy property usage.

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

This attempts to fix a large regression introduced in #36343, which broke recursing values returned from `getter` Constraints, because they are now wrapped  in in a `LazyProperty`. The `LazyProperty` needs to be evaluated because some checks are done on the type of `$value`, i.e `is_array` etc... in `validateGenericNode`.

I'm concerned that the original PR didn't really add sufficient test coverage for the introduction of `LazyProperty`, and I'm not 100% sure that I've caught all the cases where the `instanceof` check are needed in this PR.

For the tests, I added the `@dataProvider getConstraintMethods` to every test that hit the problem area of code.

~~The only issue is that my fixed has broken the test introduced in #36343, `testGroupedMethodConstraintValidateInSequence`.~~

~~I think I need @HeahDude to help me work through this. Maybe there is a more simple solution, one that doesn't require doing `instanceof LazyPropery` checks in multiple places, because this feels very brittle.~~
EDIT: fixed that test.

Commits
-------

281861e788 [Validator] fix lazy property usage.
2020-05-02 08:43:10 +02:00
Ben Davies
281861e788 [Validator] fix lazy property usage. 2020-05-02 08:43:03 +02:00
Christian Flothmann
d765a0999d minor #36654 Fix Form annotation (VincentLanglet)
This PR was merged into the 3.4 branch.

Discussion
----------

Fix Form annotation

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

Symfony form component provide his own exception `OutOfBoundsException` which is implementing `ExceptionInterface`. Form are returning this custom `OutOfBoundsException`, but the phpDoc say it's an original `\OutOfBoundsException`, which is not extending the `ExceptionInterface`.

This can provide issue with static analysis tools.

Commits
-------

67b744929f Fix annotation
2020-05-02 08:35:59 +02:00
Vincent Langlet
67b744929f Fix annotation 2020-05-01 19:30:18 +02:00
Fabien Potencier
f7749c3774 bug #36625 [PhpUnitBridge] fix compat with PHP 5.3 (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[PhpUnitBridge] fix compat with PHP 5.3

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

Commits
-------

856ba8c98f [PhpUnitBridge] fix compat with PHP 5.3
2020-04-30 15:45:08 +02:00
Nicolas Grekas
856ba8c98f [PhpUnitBridge] fix compat with PHP 5.3 2020-04-29 17:41:38 +02:00
Fabien Potencier
ad6f8608e9
Merge pull request #36612 from fabpot/release-3.4.40
released v3.4.40
2020-04-28 19:41:57 +02:00
Fabien Potencier
f59e0e9c23 updated VERSION for 3.4.40 2020-04-28 19:41:38 +02:00