Commit Graph

38475 Commits

Author SHA1 Message Date
Artem Lopata
728cd66a13 RepeatedType should always have inner types mapped 2020-04-10 21:29:36 +02:00
Ivan Grigoriev
67f336b808
do not merge constraints within interfaces 2020-04-09 15:51:11 +03:00
Jules Pietri
117ee34698
[Validator] Fixed default group for nested composite constraints 2020-04-08 12:54:36 +02:00
Grégoire Pineau
932a4f86ed bug #36375 [Workflow] Use a strict comparison when retrieving raw marking in MarkingStore (lyrixx)
This PR was merged into the 3.4 branch.

Discussion
----------

[Workflow] Use a strict comparison when retrieving raw marking in MarkingStore

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

Commits
-------

aebe8ae163 [Workflow] Use a strict comparison when retrieving raw markin in MarkingStore
2020-04-07 15:25:13 +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
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
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
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
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
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
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
6dbf9eb663 bug #36332 [Serializer] Fix unitialized properties (from PHP 7.4.2) when serializing context for the cache key (alanpoulain)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Serializer] Fix unitialized properties (from PHP 7.4.2) when serializing context for the cache key

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix https://github.com/symfony/symfony/issues/35574 https://github.com/doctrine/orm/issues/8030
| License       | MIT
| Doc PR        | N/A

This bug only happens on the following conditions:
- A Doctrine entity (`Book`) having a relation with another entity (`Author`) is used;
- The `Author` entity uses typed properties (PHP 7.4) not initialized;
- The `Serializer` is used with the `Book` in the `OBJECT_TO_POPULATE` key in the context.

For instance:
```php
<?php

declare(strict_types=1);

namespace App\Entity;

use Doctrine\ORM\Mapping as ORM;

/** @ORM\Entity */
class Book
{
    /**
     * @ORM\ManyToOne(targetEntity="Author")
     */
	public Author $author;

	public ?string $isbn;
}
```

```php
<?php

declare(strict_types=1);

namespace App\Entity;

use Doctrine\ORM\Mapping as ORM;

/** @ORM\Entity */
class Author
{
    public ?string $name;
}
```

Or even:

```php
<?php

declare(strict_types=1);

namespace App\Entity;

use Doctrine\ORM\Mapping as ORM;

/** @ORM\Entity */
class Author
{
    private string $name;

    public function __construct()
    {
        $this->name = 'Leo';
    }
}
```

If the following is done (it's the case for instance in API Platform when a `PUT` is made):
```php
$serializer->deserialize('{"isbn":"2038717141"}', Book::class, 'json', ['object_to_populate' => $book]);
```

Then there will be the following error:
> Fatal error: Typed property Proxies\__CG__\App\Entity\Author::$ must not be accessed before initialization (in __sleep)

It's because of these lines in the `getCacheKey` method of the `AbstractObjectNormalizer`:
5da141b8d0/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php (L405-L409)

Since the lazy proxyfied relation has a `__sleep` with unitialized properties, the `serialize` method will throw (since https://bugs.php.net/bug.php?id=79002: 846b647953).

I propose to fix this issue by unsetting the `OBJECT_TO_POPULATE` key in the context because I don't think it's useful for determining the attributes of the object.

For the next versions of Symfony, the fix should probably be elsewhere, in the default context.
For instance in Symfony 4.4, instead of:
15edfd39d4/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php (L118)
It should be:
```php
$this->defaultContext[self::EXCLUDE_FROM_CACHE_KEY] = [self::CIRCULAR_REFERENCE_LIMIT_COUNTERS, self::OBJECT_TO_POPULATE];
```
But I'm not sure how it should be merged (another PR maybe?).

Commits
-------

1fafff7c10 [Serializer] Fix unitialized properties (from PHP 7.4.2) when serializing context for the cache key
2020-04-04 09:17:03 +02:00
Alan Poulain
1fafff7c10 [Serializer] Fix unitialized properties (from PHP 7.4.2) when serializing context for the cache key 2020-04-04 09:16:57 +02:00
Fabien Potencier
60a35f8a76 minor #36251 [Validator] Add missing Ukrainian and Russian translations (slunak)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Validator] Add missing Ukrainian and Russian translations

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

Commits
-------

d43ef4ec92 [Validator] Add missing Ukrainian and Russian translations
2020-04-04 09:09:17 +02:00
Serhiy Lunak
d43ef4ec92 [Validator] Add missing Ukrainian and Russian translations 2020-04-04 09:09:10 +02:00
rosier
923c24f438 No need to reconnect the bags to the session
Bug https://bugs.php.net/70013 was fixed before the release of PHP v7.0
2020-04-02 20:46:08 +02:00
ampaze
7f33f1fa3a
Support for Content Security Policy style-src-elem and script-src-elem in WebProfiler
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.
2020-04-02 13:53:10 +02:00
Thomas Calvet
b4df2b9dff [PropertyInfo][ReflectionExtractor] Check the array mutator prefixes last when the property is singular 2020-04-01 19:12:29 +02:00
Fabien Potencier
5da141b8d0 minor #36293 Fix wrong namespaces (fabpot)
This PR was merged into the 3.4 branch.

Discussion
----------

Fix wrong namespaces

| 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 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | n/a

Commits
-------

bbc08d7a9e Fix wrong namespaces
2020-04-01 08:16:13 +02:00
Fabien Potencier
bbc08d7a9e Fix wrong namespaces 2020-04-01 07:52:50 +02:00
Nicolas Grekas
0b27194b4f bug #36239 [HttpKernel][LoggerDataCollector] Prevent keys collisions in the sanitized logs processing (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel][LoggerDataCollector] Prevent keys collisions in the sanitized logs processing

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

`$sanitizedLogs` is used with numeric and "associative" keys. To prevent collisions when the message is a number, we can simply prepend all messages with a random letter (so we avoid a behavior refactor). It doesn't matter since they key is only used for the processing, it is dropped at the end.

Commits
-------

79fe888072 [HttpKernel][LoggerDataCollector] Prevent keys collisions in the sanitized logs processing
2020-03-31 20:24:22 +02:00
Nicolas Grekas
b9c2693527 bug #36245 [Validator] Fixed calling getters before resolving groups (HeahDude)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Fixed calling getters before resolving groups

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

Commits
-------

edcfd600aa [Validator] Fixed calling getters before resolving groups
2020-03-31 20:23:36 +02:00
Fabien Potencier
e1c48f3449 Fix versions 2020-03-30 13:26:49 +02:00
Fabien Potencier
b1d21afab5 bug #36252 [Security/Http] Allow setting cookie security settings for delete_cookies (wouterj)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security/Http] Allow setting cookie security settings for delete_cookies

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix https://github.com/symfony/symfony/pull/36243#discussion_r399646893
| License       | MIT
| Doc PR        | tbd

Similar to #36173 and #36175. This is needed for Chrome 80 compatibility.

My only question is whether we should introduce these specific settings, or somehow fetch them from `framework.session`?

Commits
-------

a696d1f3af [Security/Http] Allow setting cookie security settings for delete_cookies
2020-03-30 13:25:40 +02:00
Fabien Potencier
c266ab1fa7 bug #36261 [FrameworkBundle] revert to legacy wiring of the session when circular refs are detected (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] revert to legacy wiring of the session when circular refs are detected

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

As introduced and reported in the linked PR.

Commits
-------

35644cf8dd [FrameworkBundle] revert to legacy wiring of the session when circular refs are detected
2020-03-30 13:23:19 +02:00
Wouter de Jong
a696d1f3af [Security/Http] Allow setting cookie security settings for delete_cookies 2020-03-30 12:37:52 +02:00
Nicolas Grekas
35644cf8dd [FrameworkBundle] revert to legacy wiring of the session when circular refs are detected 2020-03-30 10:28:11 +02:00
Fabien Potencier
2555bfffa9 bumped Symfony version to 3.4.40 2020-03-30 08:41:06 +02:00
Fabien Potencier
29ccc948a8
Merge pull request #36260 from fabpot/release-3.4.39
released v3.4.39
2020-03-30 08:25:29 +02:00
Fabien Potencier
70094979f2 updated VERSION for 3.4.39 2020-03-30 08:25:13 +02:00
Fabien Potencier
7da913baa9 update CONTRIBUTORS for 3.4.39 2020-03-30 08:25:10 +02:00
Fabien Potencier
40031f2020 updated CHANGELOG for 3.4.39 2020-03-30 08:24:11 +02:00
Jules Pietri
edcfd600aa
[Validator] Fixed calling getters before resolving groups 2020-03-28 12:30:54 +01:00
Fabien Potencier
29c80e81a3 minor #36241 update Italian translation (garak)
This PR was submitted for the 4.4 branch but it was merged into the 3.4 branch instead.

Discussion
----------

update Italian translation

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

Update Italian with new translations added in Symfony 4.4

Commits
-------

6231b04079 update Italian translation
2020-03-28 11:15:01 +01:00
Massimiliano Arione
6231b04079 update Italian translation 2020-03-28 11:14:53 +01:00
Christian Flothmann
0469be9b9b bug #36216 [Validator] Assert Valid with many groups (phucwan91)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Assert Valid with many groups

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

Make a reference object get validated by each group when using the Valid constraint with many groups

Commits
-------

c9aa3a849a bug #36157 [Validator] Assert Valid with many groups
2020-03-28 10:30:39 +01:00
Christian Flothmann
a61101c04d minor #36233 [Validator] Add missing vietnamese translations (jschaedl)
This PR was merged into the 3.4 branch.

Discussion
----------

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

25fdc8e580 [Validator] Add missing vietnamese translations
2020-03-28 09:11:11 +01:00
Christian Flothmann
d1eb801e1a minor #36231 [Validator] Add Hungarian translations (1ed)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Add Hungarian translations

| Q             | A
| ------------- | ---
| Branch?       | 3.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/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
-------

9c1c9347c0 [Validator] Add missing Hungarian translations
2020-03-28 09:09:23 +01:00
Gábor Egyed
9c1c9347c0 [Validator] Add missing Hungarian translations 2020-03-28 09:09:23 +01:00
Christian Flothmann
c22d07c272 minor #36221 [Validator] Add the missing translations for the Arabic (ar) locale (Ahmed Raafat)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #36221).

Discussion
----------

[Validator] Add the missing translations for the Arabic (ar) locale

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

This is a basic PR to add the missing Validator translations for AR Locale.

Commits
-------

d3fa02a918 [Validator] Add the missing translations for the Arabic (ar) locale
2020-03-28 09:07:34 +01:00
Ahmed Raafat
d3fa02a918 [Validator] Add the missing translations for the Arabic (ar) locale 2020-03-28 09:07:27 +01:00