Commit Graph

46644 Commits

Author SHA1 Message Date
Nicolas Grekas ac5f45b73a minor #36402 [Twig][Mime] Removed extra quotes in missing package exception message (mikemilano)
This PR was submitted for the master branch but it was squashed and merged into the 4.4 branch instead.

Discussion
----------

[Twig][Mime] Removed extra quotes in missing package exception message

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

The missing package exception copy had a double quote in the composer command disrupting the ability to copy/paste the command.

> try running "composer require "twig/cssinliner-extra twig/inky-extra"

This PR removes the quote before the package name so it reads:

> try running "composer require twig/cssinliner-extra twig/inky-extra"

Commits
-------

b2c9a6ea91 [Twig][Mime] Removed extra quotes in missing package exception message
2020-04-10 22:28:53 +02:00
Mike Milano b2c9a6ea91 [Twig][Mime] Removed extra quotes in missing package exception message 2020-04-10 22:28:12 +02:00
Nicolas Grekas 015d8d7e86 [DI] µfix 2020-04-10 22:02:31 +02:00
Artem Lopata 728cd66a13 RepeatedType should always have inner types mapped 2020-04-10 21:29:36 +02:00
oesteve 7ccbef62f6 Force ping after transport Exception 2020-04-10 20:51:00 +02:00
Ryan Weaver c9bf0c8683 Allowing empty secrets to be set 2020-04-09 10:53:24 -04:00
Ivan Grigoriev 67f336b808
do not merge constraints within interfaces 2020-04-09 15:51:11 +03:00
Nicolas Grekas a6a4442cd9 [DI] add missing property declarations in InlineServiceConfigurator 2020-04-09 10:43:57 +02:00
Nicolas Grekas bf17165fb1 [DI] fix detecting short service syntax in yaml 2020-04-08 16:17:20 +02:00
Jules Pietri 117ee34698
[Validator] Fixed default group for nested composite constraints 2020-04-08 12:54:36 +02:00
Michel Bardelmeijer b98abde65a Supress error from fread when reading a unix pipe 2020-04-07 21:12:26 +02:00
Grégoire Pineau 0506f8ce2b Merge remote-tracking branch 'origin/3.4' into 4.4
* origin/3.4:
  [Workflow] Use a strict comparison when retrieving raw markin in MarkingStore
2020-04-07 15:32:43 +02:00
Grégoire Pineau e129a1655d bug #36376 [Workflow] Use a strict comparison when retrieving raw marking in MarkingStore (lyrixx)
This PR was merged into the 4.4 branch.

Discussion
----------

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

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

Commits
-------

a00a2f1115 [Workflow] Use a strict comparison when retrieving raw marking in MarkingStore
2020-04-07 15:25:58 +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
Antonio Pauletich a07578dba3 [HttpClient] Fix scoped client without query option configuration 2020-04-07 14:53:04 +02:00
Grégoire Pineau a00a2f1115 [Workflow] Use a strict comparison when retrieving raw marking in MarkingStore 2020-04-07 11:51:42 +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 f72dd9cafa Merge branch '3.4' into 4.4
* 3.4:
  [PropertyAccess] fix tests
  [WebProfilerBundle] fix test
  remove assertions that can never be reached
  [PropertyAccess] Improve message of unitialized property in php 7.4
  [HttpFoundation] Fixed session migration with custom cookie lifetime
  [Serializer] Remove unused variable
  Allow URL-encoded special characters in basic auth part of URLs
  [Serializer] Fix unitialized properties (from PHP 7.4.2) when serializing context for the cache key
  [Validator] Add missing Ukrainian and Russian translations
  No need to reconnect the bags to the session
  Support for Content Security Policy style-src-elem and script-src-elem in WebProfiler
  [PropertyInfo][ReflectionExtractor] Check the array mutator prefixes last when the property is singular
2020-04-06 12:16:26 +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 a56f98cbdc bug #36342 [HttpKernel][FrameworkBundle] fix compat with Debug component (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel][FrameworkBundle] fix compat with Debug component

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

Fixes the issue as described by @stof in #36009

Commits
-------

d5c54c2fa7 [HttpKernel][FrameworkBundle] fix compat with Debug component
2020-04-05 08:42:43 +02:00
Nicolas Grekas d5c54c2fa7 [HttpKernel][FrameworkBundle] fix compat with Debug component 2020-04-04 13:58:35 +02:00
Fabien Potencier d33392f136 minor #36246 [Routing] Add installation and minimal example to README (wouterj)
This PR was merged into the 4.4 branch.

Discussion
----------

[Routing] Add installation and minimal example to README

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

Similair to what I did in #35552, this PR updates the README of the Routing component to include a minimal example and installation command.

Commits
-------

be6612060c Add installation and minimal example to README
2020-04-04 11:11:00 +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 38cbcc6d4f bug #36335 [Security] Track session usage whenever a new token is set (wouterj)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security] Track session usage whenever a new token is set

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

When using `anonymous: lazy`, the programatic login using the guard handler is broken. As the `setToken()` does not track usage, the index remains equal.

I tried fixing this more properly in e.g. the `SessionStrategy::onAuthentication` class, but I couldn't get it working (as `$request->hasPreviousSession()` returns false, the session strategy isn't called). `setToken()` can also not be made usage tracking afaics, because it would directly break (`setToken(null)` is called in `ContextListener`).

The current fix does however look really ugly, but I can't find anything better with my minor knowledge of this session usage tracking feature. I'm open for all ideas :)

Commits
-------

8d96dbd08b Track session usage when setting the token
2020-04-04 09:19:12 +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 718722d433 bug #36337 [4.4][MonologBridge] Fix $level type (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[4.4][MonologBridge] Fix $level type

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/pull/36334#issue-398177378
| License       | MIT
| Doc PR        | -

Commits
-------

19a8905d32 [4.4][MonologBridge] Fix $level type
2020-04-04 09:11:51 +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
Wouter de Jong 8d96dbd08b Track session usage when setting the token 2020-04-03 19:46:33 +02:00
Thomas Calvet 19a8905d32 [4.4][MonologBridge] Fix $level type 2020-04-03 17:02:39 +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
Nicolas Grekas 15edfd39d4 bug #36223 [Security][Http][SwitchUserListener] Ignore all non existent username protection errors (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security][Http][SwitchUserListener] Ignore all non existent username protection errors

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

Since we generate the non existent username blindly, it can lead to Doctrine exceptions or any other exception.

We can catch all exceptions here but I guess it reduces the protection since the SQL query was not executed?

Alternative: we can only catch Doctrine DriverException (in addition to the existing AuthenticationException) and only silent the reported error codes?

Commits
-------

42311d5c29 [Security][Http][SwitchUserListener] Ignore all non existent username protection errors
2020-04-01 11:28:26 +02:00
Thomas Calvet 42311d5c29 [Security][Http][SwitchUserListener] Ignore all non existent username protection errors 2020-04-01 11:15:47 +02:00
Fabien Potencier be0515ffb6 minor #36294 Namespace fixes 44 (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

Namespace fixes 44

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

Commits
-------

801f2d344e Fix wrong namespaces
2020-04-01 08:27:23 +02:00