Commit Graph

36734 Commits

Author SHA1 Message Date
Alexander Schranz
49b58ed45e Avoid using of kernel after shutdown 2019-11-03 20:32:26 +01:00
Fabien Potencier
0af10ccd0d minor #34160 Adding some validations tags on validators.et.xlf (glodzienski)
This PR was merged into the 3.4 branch.

Discussion
----------

Adding some validations tags on validators.et.xlf

| Q             | A
| ------------- | ---
| Branch?       | 4.4 for features / 3.4 or 4.3 for bug fixes <!-- see below -->
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/30160
| License       | MIT

I saw an issue in the **Issues Page** and i want to help to improve the repository, even with a simple modification

Commits
-------

16bd71b5b1 Adding some validations tags on validators.et.xlf
2019-11-03 18:41:53 +01:00
Fabien Potencier
78bdf1a307 minor #34153 [Validator] add missing translation for 94 (it) (garak)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] add missing translation for 94 (it)

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

Italian translation for validator is missing last item (id 94)

Commits
-------

1dc7ce1159 add missing translation for 94 (it)
2019-11-03 18:21:08 +01:00
Fabien Potencier
9162892fd4 bug #34181 [Stopwatch] Fixed bug in getDuration when counting multiple ongoing periods (TimoBakx)
This PR was merged into the 3.4 branch.

Discussion
----------

[Stopwatch] Fixed bug in getDuration when counting multiple ongoing periods

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

When running multiple periods in StopwatchEvent (start multiple times and not stop them all), the getDuration() method would return unexpected values.

This was because at every stop, the last entry in the `started` array was removed, while the `getDuration` method was still expecting all the started events to still be there.

Now, when calling `getDuration`, the duration of all the finished periods are added together with the unfinished counts.

Commits
-------

af00d8deab [Stopwatch] Fixed bug in getDuration when counting multiple ongoing periods
2019-11-03 18:17:59 +01:00
Fabien Potencier
142bdddece bug #34165 [PropertyInfo] Fixed type extraction for nullable collections of non-nullable elements (happyproff)
This PR was squashed before being merged into the 4.3 branch (closes #34165).

Discussion
----------

[PropertyInfo] Fixed type extraction for nullable collections of non-nullable elements

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

When an annotation is declared as `int[]|null`, it is handled like `(int|null)[]|null`. So array values are also nullable.

Now this behavior is fixed that `int[]|null` is either a collection of integers only or null.

How to reproduce:
```php
class Dummy
{
    /** @var int[]|null */
    public $nullableCollectionOfNonNullableElements;
}

/** @var Type[] $types */
$types = (new PhpDocExtractor())->getTypes(Dummy::class, 'nullableCollectionOfNonNullableElements');

$collectionType = $types[0];
assert($collectionType->isCollection() === true); // OK
assert($collectionType->isNullable() === true); // OK
assert($collectionType->getCollectionValueType()->getBuiltinType() === Type::BUILTIN_TYPE_INT); // OK
assert($collectionType->getCollectionValueType()->isNullable() === false); // FAILED
```

Commits
-------

5e394c40f0 [PropertyInfo] Fixed type extraction for nullable collections of non-nullable elements
2019-11-03 13:19:19 +01:00
Stanislav Gamayunov
5e394c40f0 [PropertyInfo] Fixed type extraction for nullable collections of non-nullable elements 2019-11-03 13:19:12 +01:00
Fabien Potencier
767b265681 bug #34179 [Stopwatch] Fixed a bug in StopwatchEvent::getStartTime (TimoBakx)
This PR was merged into the 3.4 branch.

Discussion
----------

[Stopwatch] Fixed a bug in StopwatchEvent::getStartTime

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

When using a `StopwatchEvent` with an `$origin` that's smaller than the first start time, calling `getStartTime()` before ending the event will give `0` instead of the correct number.

The proposed fix in #34088 fixes this.

Commits
-------

b2b7eab949 [Stopwatch] Fixed a bug in stopwatch event getStartTime
2019-11-03 13:11:53 +01:00
Eric Schildkamp
613717d71f [FrameworkBundle] [HttpKernel] fixed correct EOL and EOM month
* Added a hardcoded day 01 in order to output the proper month November
which is the correct EOL and EOM month.
* \DateTime::createFromFormat('mY') will output December for every month
where day 31 exists.
2019-11-03 13:06:33 +01:00
Fabien Potencier
08a218c79f bug #34218 [Security] Fix SwitchUserToken wrongly deauthenticated (chalasr)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security] Fix SwitchUserToken wrongly deauthenticated

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

Commits
-------

e47b31c43c [Security] Fix SwitchUserToken wrongly deauthenticated
2019-11-03 13:01:14 +01:00
Fabien Potencier
0c784d2879 feature #32061 Add new Form WeekType (dFayet)
This PR was merged into the 4.4 branch.

Discussion
----------

Add new Form WeekType

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #32029
| License       | MIT
| Doc PR        | <!--symfony/symfony-docs#...--> coming soon

----
#### Update

After the first try, I've updated the field to have more options, and be more "straight".
The field acts like the `DateTimeType` or `TimeType`,  various fields type (pure text, html5 type, select boxes), data validation, ....

For that I took the choice to update the `DateTimeToStringTransformer` and `DateTimeToArrayTransformer` to make them work with weeks format.

I was not sure if it was better to update them or create new ones, WDYT?

Before addind tests and docs, it would be nice to have your first thoughts/comments 😊

Do you need/want a small test repo?

Commits
-------

c4a2f026e0 Add new Form WeekType
2019-11-03 12:59:10 +01:00
Fabien Potencier
ef66ad3890 feature #33954 Form theme: support Bootstrap 4 custom switches (romaricdrigon)
This PR was merged into the 4.4 branch.

Discussion
----------

Form theme: support Bootstrap 4 custom switches

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

Hello,

At the moment, Symfony form theme supports [custom checkboxes](https://getbootstrap.com/docs/4.3/components/forms/#checkboxes) through an extra class in `label_attr`.
Bootstrap4 introduced also [custom switches](https://getbootstrap.com/docs/4.3/components/forms/#switches), which has exactly the same HTML markup, but use a different class. This PR slightly modify `bootstrap_4_layout` to handle it.

![image](https://user-images.githubusercontent.com/919405/66651725-0eaa3100-ec34-11e9-8b68-94324730ac80.png)

Some reasons why I think supporting those have its place in Symfony:
 - those are getting common in UI right now, it is a common use case
 - it is complementary to normal checkboxes, and works the same way: required attribute, validation error, and so on are supported immediately
 - implementing it yourself in your form theme is actually tricky, because of the way checkbox are handled (ie., `form_label` called inside `form_widget` with a `{ widget: parent() }`). You have to overwrite the whole fragment, otherwise you get an infinite recursion.

Finally, some screenshots and code examples.

Custom checkbox (as at the moment):
![image](https://user-images.githubusercontent.com/919405/66652982-41a1f400-ec37-11e9-813f-4b39087e89e7.png)
```php
    ->add('test', CheckboxType::class, [
        'label_attr' => [
            'class' => 'checkbox-custom',
        ],
    ])
```
Custom switch (proposed):
![image](https://user-images.githubusercontent.com/919405/66652902-1919fa00-ec37-11e9-98f3-9340b01b2335.png)
```php
    ->add('test', CheckboxType::class, [
        'label_attr' => [
            'class' => 'switch-custom',
        ],
    ])
```

Commits
-------

99f59e262f Supporting Bootstrap 4 custom switches
2019-11-03 12:57:04 +01:00
Fabien Potencier
25baf75edb Fix CS 2019-11-03 12:51:47 +01:00
Fabien Potencier
71873fc770 feature #33854 [DI] Add ability to choose behavior of decorations on non existent decorated services (mtarld)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] Add ability to choose behavior of decorations on non existent decorated services

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

# Handling decorations on non existent decorated services
Handle decorations on non existent decorated services by either throwing the service not found exception, silently ignoring services (decorator & decorated) all together or leave the decorated service to null (current behavior)

Something almost similar to how missing services as parameters are handles.

## Yaml configuration
```yaml
decorator:
    decorates: decorated
    decoration_on_invalid: ignore
```
Available values: `exception`, `ignore`, `null`. `exception` if nothing is specified.

## Xml configuration
```xml
<service id="decorator" decorates="decorated" decoration-on-invalid="ignore" />
```
Available values: `exception`, `ignore`, `null`. `exception` if nothing is specified.

## Behavior
- `exception`: Throws a `ServiceNotFoundException` telling that the decorator's dependency is missing
- `ignore`: Remove decorator definition. Decorator and decorated will not be available at all.
- `null`: Keep decorator but set decorated to null. Therefore, decorator `__construct` should be written with a nullable decorated dependency (`public function __contruct(?DecoratedInterface $decorated) {}`) and check should be done in other methods

Commits
-------

f167c77eaf Handle non existent decorated services
2019-11-03 12:49:07 +01:00
Fabien Potencier
22976d0f54 bug #34035 [Serializer] Fix property name usage for denormalization (antograssiot)
This PR was squashed before being merged into the 4.3 branch (closes #34035).

Discussion
----------

[Serializer] Fix property name usage for denormalization

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

Using the `@SerializedName()` and passing it an existing property name affects the deserialization even if `@Groups()` are not supposed to be involved.

## How to reproduce

Given the following class
```php

class Foo
{
    /**
     * @Group("list")
     */
    private $bar;

    public function setBar($bar)
    {
        $this->bar = $bar;
    }
    public function getBar()
    {
        return $this->bar;
    }
    /**
     * @Groups({"list:export"})
     * @SerializedName("bar")
     */
    public function getBarForExport()
    {
        return $this->bar.' Rocks';
    }
}
```

This allow us to change the content of the property based on the normalization context.

```php
$obj = new Foo();
$obj->setBar('Api Platform');

$data = $normalizer->normalize($obj, null, ['groups' => ["list"]]);
// $data => ['bar' => 'Api Platform'] as expected

$data = $normalizer->normalize($obj, null, ['groups' => ["list:export"]]);
// $data => ['bar' => 'Api Platform Rocks'] as expected

$obj = $normalizer->denormalize(['bar' => 'Api Platform'], Foo::class, null, ['groups' => ['list']]);
// $obj->getBar()  would return null instead of 'Api Platform' as expected.
```

Commits
-------

8ca4a3f345 [Serializer] Fix property name usage for denormalization
2019-11-03 12:04:07 +01:00
Anto
8ca4a3f345 [Serializer] Fix property name usage for denormalization 2019-11-03 12:04:02 +01:00
Oskar Stark
2ce086ab29
Name test accordingly to the tested class 2019-11-03 10:04:05 +01:00
HypeMC
51b20dd895 Fix MockFileSessionStorageTest::sessionDir being used after it's unset 2019-11-03 03:12:45 +01:00
Robin Chalas
e47b31c43c [Security] Fix SwitchUserToken wrongly deauthenticated 2019-11-02 08:21:17 +01:00
Fabien Potencier
bbbbb2189a minor #34215 Fix typo (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

Fix typo

| Q             | A
| ------------- | ---
| Branch?       | 4.4 <!-- see below -->
| Bug fix?      | yes
| 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
<!--
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
-------

327a13cac0 Fix typo
2019-11-01 17:43:39 +01:00
Fabien Potencier
327a13cac0 Fix typo 2019-11-01 17:09:13 +01:00
Romaric Drigon
99f59e262f Supporting Bootstrap 4 custom switches 2019-11-01 16:05:06 +01:00
dFayet
c4a2f026e0 Add new Form WeekType 2019-11-01 15:48:13 +01:00
Tobias Schultze
3936b78830 feature #34185 [Messenger] extract worker logic to listener and get rid of SendersLocatorInterface::getSenderByAlias (Tobion)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger]  extract worker logic to listener and get rid of SendersLocatorInterface::getSenderByAlias

| 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 #32077 and #31848
| License       | MIT
| Doc PR        |

as discussed with @weaverryan sending messages for retry and failure directly to transport instead of redispatching on the bus makes things much cleaner

Commits
-------

d7e0f98cd0 [Messenger] extract worker logic to listener and sent messages for retry and failure directly to transport instead of redispatching on the bus
2019-11-01 13:36:19 +01:00
Fabien Potencier
ce6332ce71 bumped Symfony version to 4.3.7 2019-11-01 11:04:19 +01:00
Fabien Potencier
b959f05d98 updated VERSION for 4.3.6 2019-11-01 11:00:03 +01:00
Fabien Potencier
36c4c66a60 bumped Symfony version to 3.4.34 2019-11-01 10:59:17 +01:00
Fabien Potencier
a3ae48695d updated VERSION for 3.4.33 2019-11-01 10:46:31 +01:00
Ryan Weaver
e7b98880aa Adding DoctrineClearEntityManagerWorkerSubscriber to reset entity manager in worker 2019-10-31 13:26:56 -04:00
Tobias Schultze
d7e0f98cd0 [Messenger] extract worker logic to listener and sent messages for retry
and failure directly to transport instead of redispatching on the bus
2019-10-31 15:47:36 +01:00
Tobias Schultze
cf10c02765 minor #34155 Revert SyncTransport simplification and fix properly (weaverryan)
This PR was squashed before being merged into the 4.4 branch (closes #34155).

Discussion
----------

Revert SyncTransport simplification and fix properly

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34115 (and also related to #34066)
| License       | MIT
| Doc PR        | Not needed

In #34069, I made `SyncTransport` simpler by removing that transport class and making the whole things a config trick. I felt GREAT about that solution... until i realized two big problems:

1) It kills using env vars for `sync://` because we read the config values at build time - #34115 - that could probably be fixed by adding a factory, but then there is also the next problem

2) If someone routed a message to `[async, sync]` (weird, but allowed), my #34069 config solution basically maps this internally to `[async]`, which actually causes the message to *not* be handled immediately. Basically, my solution only worked if you route a message ONLY to one sync transport, but fails if you route to multiple transports.

So... this fixes things in a less-cool, but sensible way:

A) The first commit reverts #34069 exactly
B) The second commit solves the issue that we need to know if a message is being handled in a "worker" context or not, so middleware can decide if they should reset things before/after handling things. Previously we were using `ReceivedStamp` to know this. But because `SyncTransport` also "receives" the message and adds this stamp, it's not enough. To fix this, I added a new `ConsumedByWorkerStamp` that clearly means: "This message is being handled by a worker" (and so, you might want to "reset" some things before/after handling).

Thanks!

Commits
-------

01a9fefe77 Adding ConsumedByWorkerStamp as way to mark a message in a "worker context"
38f19a960c Revert "[Messenger] Removing "sync" transport and replacing it with much nicer config trick"
2019-10-31 15:10:54 +01:00
Yonel Ceruto
45f1a5ee06 Show generic message in non-debug mode 2019-10-31 09:58:15 -04:00
Nicolas Grekas
e388b739ed [HttpClient] Fix perf issue when doing thousands of requests with curl 2019-10-31 08:19:20 +01:00
Nicolas Grekas
aea43b27b0 minor #34166 [VarDumper] Do not dump the EventDispatcher (lyrixx)
This PR was merged into the 4.4 branch.

Discussion
----------

[VarDumper] Do not dump the EventDispatcher

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

Commits
-------

31c402a003 [VarDumper] Do not dump the EventDispatcher
2019-10-30 22:27:22 +01:00
Antonio Pauletich
16c9bafee4
Fix URL generator instantiation 2019-10-30 20:24:37 +01:00
Nicolas Grekas
38bd52e9be feature #34133 [Cache] add DeflateMarshaller - remove phpredis compression (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache] add DeflateMarshaller - remove phpredis compression

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

phpredis compression doesn't play well with lua scripting as used in #33939
Let's remove it and provide a `DeflateMarshaller` instead.

Ppl can use it via decoration:
```yaml
services:
    Symfony\Component\Cache\Marshaller\DeflateMarshaller:
        decorates: cache.default_marshaller
        arguments: ['@Symfony\Component\Cache\Marshaller\DeflateMarshaller.inner']
```

It's not enabled by default because that might break pools that are shared between different apps.

/cc @andrerom FYI

Commits
-------

452c863639 [Cache] add DeflateMarshaller - remove phpredis compression
2019-10-30 17:54:40 +01:00
Nicolas Grekas
8cf0698e85 bug #34163 [DI] fix regexp for anonymous services with no class set (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] fix regexp for anonymous services with no class set

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

Follows #33782

Commits
-------

a302d2050e [DI] fix regexp for anonymous services with no class set
2019-10-30 17:53:52 +01:00
Nicolas Grekas
cc357ad70c [Validator] fix merge 2019-10-30 14:47:18 +01:00
Nicolas Grekas
94beae00b1 Merge branch '4.3' into 4.4
* 4.3:
  [4.3] Remove unused local variables
2019-10-30 14:23:44 +01:00
Nicolas Grekas
e8b31ff608 minor #34176 [4.3] Remove unused local variables (fancyweb)
This PR was merged into the 4.3 branch.

Discussion
----------

[4.3] Remove unused local variables

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

Follow up of https://github.com/symfony/symfony/pull/34105 on 4.3.

Commits
-------

58161b8eec [4.3] Remove unused local variables
2019-10-30 14:18:51 +01:00
Nicolas Grekas
301ec496ea [Lock][HttpFoundation] Hot fix 2019-10-30 14:15:17 +01:00
Timo Bakx
b2b7eab949 [Stopwatch] Fixed a bug in stopwatch event getStartTime 2019-10-30 14:03:57 +01:00
Thomas Calvet
58161b8eec [4.3] Remove unused local variables 2019-10-30 13:58:49 +01:00
Nicolas Grekas
0b5b6fa79f Merge branch '4.3' into 4.4
* 4.3:
  [Config] Disable default alphabet sorting in glob function due of unstable sort
  [HttpClient] always return the empty string when the response cannot have a body
  [TwigBundle][exception] Added missing css variable to highlight line in trace
  [Serializer] Improve messages for unexpected resources values
  [SecurityBundle] correct types for default arguments for firewall configs
2019-10-30 13:55:29 +01:00
Nicolas Grekas
1aaf58b55a Merge branch '3.4' into 4.3
* 3.4:
  [Config] Disable default alphabet sorting in glob function due of unstable sort
  [Serializer] Improve messages for unexpected resources values
  [SecurityBundle] correct types for default arguments for firewall configs
2019-10-30 13:53:54 +01:00
Nicolas Grekas
27b0baa270 bug #33998 [Config] Disable default alphabet sorting in glob function due of unstable sort (hurricane-voronin)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Config] Disable default alphabet sorting in glob function due of unstable sort

…table sort

| Q             | A
| ------------- | ---
| Branch?       | 3.4  <!-- see below -->
| 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 #33990  <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | no <!-- required for new features -->

`\Symfony\Component\Config\Resource\GlobResource::getIterator` loads files using `glob` not it the stable sorting, e.g several files: `doctrine.yml` and `doctrine_mongodb.yaml` in `config/packages` folder.
On requests these files come(randomly) in a different order, which leads to reinitialization of symfony kernel in `dev` environment. It's a little bit annoying and takes a lot of time in a common :(

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

3bed0247c0 [Config] Disable default alphabet sorting in glob function due of unstable sort
2019-10-30 13:46:47 +01:00
Denys Voronin
3bed0247c0 [Config] Disable default alphabet sorting in glob function due of unstable sort 2019-10-30 13:43:22 +01:00
Nicolas Grekas
f78e14332e [HttpClient] always return the empty string when the response cannot have a body 2019-10-30 12:53:18 +01:00
Fabien Potencier
6bb7751fc1 feature #34177 [HttpFoundation][FrameworkBundle] allow configuring the session handler with a DSN (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation][FrameworkBundle] allow configuring the session handler with a DSN

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

```yaml
framework:
    session:
        handler_id: 'redis://localhost'
        handler_id: '%env(REDIS_URL)%'
        handler_id: '%env(DATABASE_URL)%'
        handler_id: 'file://%kernel.project_dir%/var/sessions'
```

etc.

the database connection is not shared with the ORM (don't mess with transactions.)
redis/memcached connections are shared between cache and session.
(as a reminder, cache and ORM share the db connection: we're ok with trashing the cache on a rollback)

Lock-related changes are a follow up of #34043.
(fabbot failure is false positive)

Commits
-------

de9c61f423 [HttpFoundation][FrameworkBundle] allow configuring the session handler with a DSN
2019-10-30 11:42:43 +01:00
Nicolas Grekas
de9c61f423 [HttpFoundation][FrameworkBundle] allow configuring the session handler with a DSN 2019-10-30 10:56:04 +01:00
Christian Flothmann
9e7ab8c003 feature #32107 [Validator] Add AutoMapping constraint to enable or disable auto-validation (dunglas)
This PR was squashed before being merged into the 4.4 branch (closes #32107).

Discussion
----------

[Validator] Add AutoMapping constraint to enable or disable auto-validation

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #32070, #32015   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | todo

As discussed in #32070 and #32015, it's sometimes mandatory to prevent some classes or properties to be auto mapped (auto-validated). This PR introduces a new constraint, `@AutoMapping` allowing to do exactly that. Examples:

Class:

```php
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * @ORM\Entity
 * @Assert\AutoMapping(false)
 */
class DoctrineLoaderNoAutoMappingEntity
{
    /**
     * @ORM\Id
     * @ORM\Column
     */
    public $id;

    /**
     * @ORM\Column(length=20, unique=true)
     */
    public $maxLength;
}
```

Property:

```php
namespace Symfony\Bridge\Doctrine\Tests\Fixtures;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * @ORM\Entity
 */
class DoctrineLoaderEntity extends DoctrineLoaderParentEntity
{
    /**
     * @ORM\Id
     * @ORM\Column
     */
    public $id;

    /**
     * @ORM\Column(length=10)
     * @Assert\AutoMapping(false)
     */
    public $noAutoMapping;
}
```

The rules are the following:

* If the constraint is present on a property, and set to true, auto-mapping is always on, regardless of the config, and of any class level annotation
* If the constraint is present on a property, and set to false, auto-mapping is always off, regardless of the config, and of any class level annotation
* If the constraint is present on a class, and set to true, auto-mapping is always on except if a the annotation has been added to a specific property, and regardless of the config
* If the constraint is present on a class, and set to false, auto-mapping is always off except if a the annotation has been added to a specific property, and regardless of the config

Commits
-------

f6519ce88b [Validator] Add AutoMapping constraint to enable or disable auto-validation
2019-10-30 08:50:31 +01:00
Kévin Dunglas
f6519ce88b [Validator] Add AutoMapping constraint to enable or disable auto-validation 2019-10-30 08:50:22 +01:00
Robin Chalas
81b9c3c682 [DI] Fix "!tagged" related upgrade/changelog notes 2019-10-29 21:21:43 +01:00
Timo Bakx
af00d8deab [Stopwatch] Fixed bug in getDuration when counting multiple ongoing periods 2019-10-29 21:16:34 +01:00
Yonel Ceruto
2b0a5793d1 minor #34174 [TwigBundle][exception] Added missing css variable to highlight line in trace (lyrixx)
This PR was merged into the 4.3 branch.

Discussion
----------

[TwigBundle][exception] Added missing css variable to highlight line in trace

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

---

To get the yellow background
![image](https://user-images.githubusercontent.com/408368/67779323-c331b880-fa64-11e9-9a2f-97730a89a6d6.png)

Commits
-------

5f19501 [TwigBundle][exception] Added missing css variable to highlight line in trace
2019-10-29 11:04:07 -04:00
Grégoire Pineau
5f19501fc4 [TwigBundle][exception] Added missing css variable to highlight line in trace 2019-10-29 15:56:06 +01:00
Nicolas Grekas
d08273236c feature #34170 Re-allow to use "tagged" in service definitions (dunglas)
This PR was merged into the 4.4 branch.

Discussion
----------

Re-allow to use "tagged" in service definitions

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes <!-- 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

Re-allow to use `tagged` in 4.4 and 5.0. It makes it easier for bundles to support both Symfony 4.3- and Symfony 4.4+.

Needed to make API Platform compatible with Symfony 5 (api-platform/core#3009)

Commits
-------

7b7dc0df9a Re-allow to use "tagged" in service definitions
2019-10-29 15:17:53 +01:00
Kévin Dunglas
7b7dc0df9a
Re-allow to use "tagged" in service definitions 2019-10-29 15:11:25 +01:00
Kévin Dunglas
e819256ea0 [HttpFoundation] Allow to not pass a parameter to Request::isMethodSafe() 2019-10-29 14:51:13 +01:00
Grégoire Pineau
31c402a003 [VarDumper] Do not dump the EventDispatcher 2019-10-29 14:41:12 +01:00
Jérémy Derussé
2db24cf582
Add missing lock connection string in FrameworkExtension 2019-10-29 14:34:12 +01:00
Nicolas Grekas
e2c625e78b feature #34057 [Lock][Cache] Allows URL DSN in PDO adapters (jderusse)
This PR was merged into the 4.4 branch.

Discussion
----------

[Lock][Cache] Allows URL DSN in PDO adapters

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

This PR duplicate a feature from PdoSessionHandler that convert URL DSN ( ie. mysql://localhost/test) into PDO DSN (ie. mysql:host=localhost;dbname=test)

that would ease configuration by using the same well-known variable
```
framework:
  lock: '%env(DATABASE_URL)%'
```

note: I applied the same change on Cache component for consistency.

Commits
-------

474daf976e Allows URL DSN in Lock and Cache
2019-10-29 14:07:00 +01:00
Nicolas Grekas
a302d2050e [DI] fix regexp for anonymous services with no class set 2019-10-29 12:56:37 +01:00
Kévin Dunglas
54d46eef67
[DomCrawler] normalizeWhitespace should be true by default 2019-10-29 12:38:30 +01:00
Thomas Calvet
ad2ce276c7 [Serializer] Improve messages for unexpected resources values 2019-10-29 12:09:57 +01:00
Nicolas Grekas
452c863639 [Cache] add DeflateMarshaller - remove phpredis compression 2019-10-29 11:36:36 +01:00
Kévin Dunglas
42be5f8132
Merge branch '4.3' into 4.4
* 4.3:
  [DoctrineBridge] Auto-validation must work if no regex are passed
2019-10-29 11:04:46 +01:00
Kévin Dunglas
ee4b99f227
bug #33828 [DoctrineBridge] Auto-validation must work if no regex are passed (dunglas)
This PR was squashed before being merged into the 4.3 branch (closes #33828).

Discussion
----------

[DoctrineBridge] Auto-validation must work if no regex are passed

| 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       | n/a
| License       | MIT
| Doc PR        | n/a

Backport of https://github.com/symfony/symfony/pull/32107/files#r295762928.
This behavior if faulty, if no regex are passed, autvalidation must be triggered, [as done in `PropertyInfoLoader`](https://github.com/symfony/symfony/blob/4.3/src/Symfony/Component/Validator/Mapping/Loader/PropertyInfoLoader.php#L50).

Commits
-------

5ed7d6c759 [DoctrineBridge] Auto-validation must work if no regex are passed
2019-10-29 11:03:42 +01:00
Kévin Dunglas
5ed7d6c759
[DoctrineBridge] Auto-validation must work if no regex are passed 2019-10-29 11:03:05 +01:00
Robin Chalas
662b35e30e Merge branch '4.3' into 4.4
* 4.3:
  remove outdated workflow test
  drop wrong test (fix merge)
2019-10-29 04:34:23 +01:00
Robin Chalas
f233259c68 remove outdated workflow test 2019-10-29 03:10:02 +01:00
Robin Chalas
6c2253415f drop wrong test (fix merge) 2019-10-29 02:54:26 +01:00
Glodzienski
16bd71b5b1
Adding some validations tags on validators.et.xlf 2019-10-28 21:40:18 -03:00
Yonel Ceruto
cc2858f7d0 bug #34158 [ErrorRenderer] Security fix: hide sensitive error messages (dunglas)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorRenderer] Security fix: hide sensitive error messages

| 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       | n/a
| License       | MIT
| Doc PR        | n/a

This PR fixes a security issue. Exception messages must not be displayed except when debugging, because they can contain sensitive data including credentials.
For instance, PDO and Doctrine throw exception with message such as `The details are: SQLSTATE[HY000] [1045] Access denied for user 'root'@'db.example.com' (using password: NO)` revealing internal details about the infrastructure usful for an attacker.

Also, I still think that ErrorRenderer should be removed in favor of using the Serializer directly (see https://github.com/symfony/symfony/pull/33650#issuecomment-534441889). I'll try to open some PRs to do that in tomorrow.

Commits
-------

d7d7f22 [ErrorRenderer] Security fix: hide sensitive error messages
2019-10-28 19:43:36 -04:00
Kévin Dunglas
d7d7f22dbe [ErrorRenderer] Security fix: hide sensitive error messages 2019-10-28 19:37:55 -04:00
Robin Chalas
fd0ed42adb [Security] Fix merge 2019-10-28 23:18:08 +01:00
Nicolas Grekas
0f5a7b8b41 Merge branch '4.3' into 4.4
* 4.3:
  Fix an error message to be more accurate
2019-10-28 22:57:16 +01:00
Nicolas Grekas
7b3d5cd615 minor #34157 [OptionsResolver] Fix an error message to be more accurate (yceruto)
This PR was merged into the 4.3 branch.

Discussion
----------

[OptionsResolver] Fix an error message to be more accurate

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

Follow-up https://github.com/symfony/symfony/pull/30442 for 4.3

Commits
-------

1be68a752a Fix an error message to be more accurate
2019-10-28 22:53:11 +01:00
Yonel Ceruto
1be68a752a Fix an error message to be more accurate 2019-10-28 16:59:01 -04:00
Nicolas Grekas
05f7f4e147 Merge branch '4.3' into 4.4
* 4.3:
  [OptionsResolve] Revert change in tests for a not-merged change in code
  [HttpClient] fix handling of 3xx with no Location header - ignore Content-Length when no body is expected
  [Workflow] Made the configuration more robust for the 'property' key
  [Security/Core] make NativePasswordEncoder use sodium to validate passwords when possible
  #30432 fix an error message
  fix paths to detect code owners
  [HttpClient] ignore the body of responses to HEAD requests
  [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4
  [SecurityBundle] Fix wrong assertion
  Remove unused local variables in tests
  [Yaml][Parser] Remove the getLastLineNumberBeforeDeprecation() internal unused method
  Make sure to collect child forms created on *_SET_DATA events
  [WebProfilerBundle] Improve display in Email panel for dark theme
  do not render errors for checkboxes twice
2019-10-28 21:30:34 +01:00
Robin Chalas
2ecd7936b1 bug #34080 [SecurityBundle] correct types for default arguments for firewall configs (shieldo)
This PR was merged into the 3.4 branch.

Discussion
----------

[SecurityBundle] correct types for default arguments for firewall configs

| Q             | A
| ------------- | ---
| Branch?       | 3.4 (and forward)
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

Up until now, the default template arguments in the `security.firewall.config` abstract service definition have been each defined (aside from the argument for `$listeners` which is given a `collection` type) in the XML as

```xml
<argument />
```

which resolves to an empty string, despite that some of the arguments are typed to being either `bool` or `array|null` on the `Symfony\Bundle\SecurityBundle\Security\FirewallConfig` class itself.

This wouldn't be so much of a problem if the child definitions that use this as a template overrode all the arguments every time, but in the case of firewall configs that mark security as _not_ being enabled, [only the first few arguments are overwritten](https://github.com/symfony/symfony/blob/3.4/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php#L349-L352), so firewall config objects that do not have security enabled are instantiated by the DI container with parameters with some of the wrong types.

In general this wouldn't be an issue, as firewalls with security not enabled would not usually be consumed in a context where further security-related config were needed, but there is a case in `Symfony\Bundle\SecurityBundle\DataCollector\SecurityDataCollector` where the method `getSwitchUser()` on the firewall config object [can be called](https://github.com/symfony/symfony/blob/3.4/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php#L181) without checking first whether the firewall has security enabled, which leads to an exception being thrown:

```
Symfony\Component\Debug\Exception\ContextErrorException
Warning: Illegal string offset 'parameter'
in vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php (line 184)
```

which is down to the firewall config being set with an empty string rather than `null` (in which case the logic here would function as expected).

It seemed most appropriate as a fix (especially given possible introduction of scalar type hints in the future) to apply types to the default arguments so that it was no longer possible to instantiate a firewall config object with parameters of unexpected types.

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

6b7044fc01 [SecurityBundle] correct types for default arguments for firewall configs
2019-10-28 18:20:44 +01:00
Ryan Weaver
01a9fefe77 Adding ConsumedByWorkerStamp as way to mark a message in a "worker context" 2019-10-28 13:18:09 -04:00
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
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
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
3fdaf970c3 [Messenger] Fix redis test 2019-10-27 07:53:30 +01: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
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
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
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
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
Tobias Schultze
4a6ec8554e [Messenger] remove nullable max retries 2019-10-24 23:51:16 +02:00
Tobias Schultze
d211904c8e [Messenger] prevent infinite redelivery loops and blocked queues
by republishing the redelivered messages as retries with a retry limit and potential delay
2019-10-24 18:35:41 +02:00
Thomas Calvet
c07cee8f61 Remove unused local variables in tests 2019-10-24 17:33:53 +02:00
Nicolas Grekas
c5024bdbd0 feature #34051 [HttpClient] allow option "buffer" to be a stream resource (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] allow option "buffer" to be a stream resource

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

Commits
-------

e87301603e [HttpClient] allow option "buffer" to be a stream resource
2019-10-24 15:27:54 +02:00
Tristan Bessoussa
332ff8811c [Routing][Config] Allow patterns of resources to be excluded from config loading 2019-10-24 13:56:35 +02:00
Thomas Calvet
49acc16424 [Yaml][Parser] Remove the getLastLineNumberBeforeDeprecation() internal unused method 2019-10-24 12:09:03 +02:00
Yonel Ceruto
50efc1a923 Make sure to collect child forms created on *_SET_DATA events 2019-10-23 15:46:41 -04:00
Anto
402fed02e7
[WebProfilerBundle] Improve display in Email panel for dark theme 2019-10-23 19:52:52 +02:00
Tobias Schultze
b9f69441c5 bug #32341 [Messenger] Show exceptions after multiple retries (TimoBakx)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] Show exceptions after multiple retries

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #32311
| License       | MIT
| Doc PR        | n/a

After retrying a failed message, the `RedeliveryStamp` looses it's exception information. This PR will remedy that.

Commits
-------

598bd92313 [Messenger] Show exceptions on after empty fails
2019-10-23 16:09:27 +02:00
Timo Bakx
598bd92313 [Messenger] Show exceptions on after empty fails 2019-10-23 15:04:40 +02:00
Tobias Schultze
3dbe924f47 Revert "[Messenger] Fix exception message of failed message is dropped on retry"
This reverts commit 8f9f44eb21.
2019-10-23 13:26:24 +02:00
Nicolas Grekas
840f7e7d88 [Validator] Set Length::$allowEmptyString to false when a NotBlank contraint is defined 2019-10-23 12:57:33 +02:00
Douglas Greenshields
6b7044fc01
[SecurityBundle] correct types for default arguments for firewall configs 2019-10-23 10:40:35 +01:00
Nicolas Grekas
bfd308ff4a bug #34078 [FrameworkBundle] Don't reset the test container but the real one instead (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Don't reset the test container but the real one instead

| Q             | A
| ------------- | ---
| Branch?       | 4.4 for features / 3.4 or 4.3 for bug fixes <!-- see below -->
| Bug fix?      | yes/no
| New feature?  | yes/no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | yes/no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | -

After #31202 and #32056, the tearDown method keeps throwing deprecation notices about "Getting the container from a non-booted kernel". The reason is that resetting the test-container calls `$kernel->getContainer()` while the kernel has been shut down.

This fixes it and a few other glitches found meanwhile.

Commits
-------

8e16143256 [FrameworkBundle] Dont reset the test container but the real one instead
2019-10-23 11:00:45 +02:00
Nicolas Grekas
5d82cf3fca minor #34060 [SecurityBundle] test with doctrine-bundle 2 (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[SecurityBundle] test with doctrine-bundle 2

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

Commits
-------

e3261f4f7f [SecurityBundle] test with doctrine-bundle 2
2019-10-23 10:59:42 +02:00
Nicolas Grekas
8e16143256 [FrameworkBundle] Dont reset the test container but the real one instead 2019-10-23 09:54:59 +02:00
Yonel Ceruto
d91a5a067d Avoid nested exceptions if errors occur when generating file links 2019-10-23 00:12:13 -04:00
Yonel Ceruto
e07a3d7bba Import missing classes 2019-10-22 22:46:01 -04:00
Fabien Potencier
28c9f48f7e bug #34072 [Debug] remove return types that break FC badly (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Debug] remove return types that break FC badly

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

The return type on Debug's FlattenException blocks creating a child class that is compatible with both v4.4 and v5.0.
Removing it fixes the issue with no BC break.
Adding `final` on `setPrevious` will allow updating its type hint in v5.0.

Commits
-------

cb5ef6ec18 [Debug] remove return types that break FC badly
2019-10-22 19:09:30 +02:00
Nicolas Grekas
cb5ef6ec18 [Debug] remove return types that break FC badly 2019-10-22 18:54:09 +02:00
Fabien Potencier
f00390ffd7 minor #33963 Add .gitignore to .gitattributes (reedy)
This PR was merged into the 4.4 branch.

Discussion
----------

Add .gitignore to .gitattributes

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

Commits
-------

246c5fdf43 Add .gitignore to .gitattributes
2019-10-22 17:44:54 +02:00
Fabien Potencier
8c5403e2dc bug #34015 [Mailer] Fix typo (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Fix typo

| Q             | A
| ------------- | ---
| Branch?       | 4.4 for features / 3.4 or 4.3 for bug fixes <!-- see below -->
| 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 #34006
| License       | MIT
| Doc PR        | n/a

The XML is different depending on the way we are sending email. So, it's `SendEmailResult` when using the API and `SendRawEmailResult` when using the HTTP class (we are then sending the raw email).

Commits
-------

4bd7cb0368 [Mailer] Fix SES Message Id retrieval
2019-10-22 17:36:06 +02:00
Fabien Potencier
4f9d449885 feature #34028 [ExpressionLanguage][Lexer] Exponential format for number (tigr1991)
This PR was merged into the 4.4 branch.

Discussion
----------

[ExpressionLanguage][Lexer] Exponential format for number

Exponential format has been added for numbers.
Ex: 1.99E+3 === 1990,
Ex: expression (1 + 1.99E+3) = 1991

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

Exponential format has been added for numbers.
Ex: 1.99E+3 === 1990,
Expressions:
0.1e+2 = 10
1e-2 = 0.01
(1 + 1.99E+3) = 1991
and etc...

Commits
-------

430ec32992 [ExpressionLanguage][Lexer] Exponential format for number
2019-10-22 17:29:53 +02:00
Fabien Potencier
2931227cad bug #34034 [Mailer][MailchimpBridge] Don't send address names if empty string (ogizanagi)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer][MailchimpBridge] Don't send address names if empty string

| Q             | A
| ------------- | ---
| Branch?       | 4.4 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | https://github.com/symfony/symfony/pull/34029#issuecomment-543804450 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | N/A

Commits
-------

197d1236ee [Mailer][MailchimpBridge] Don't send address names if empty string
2019-10-22 17:26:22 +02:00
Fabien Potencier
effae8a643 bug #34067 Use port 465 for SES SMTP transport (rimas-kudelis)
This PR was merged into the 4.4 branch.

Discussion
----------

Use port 465 for SES SMTP transport

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

Commits
-------

8492e260cb Use port 465 for SES SMTP transport
2019-10-22 17:23:40 +02:00
Fabien Potencier
591c71bb7e bug #34066 [Messenger] Fix worker-only Doctrine middleware from running always (weaverryan)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] Fix worker-only Doctrine middleware from running always

| Q             | A
| ------------- | ---
| Branch?       | 4.4 (or 4.3?, this is a bug fix)
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #32436 Depends on #34069
| License       | MIT
| Doc PR        | not needed

Several Doctrine middleware are only meant to be run in a "worker" context: we want to "ping" the connection, "close" the connection and "clear" the entity manager ONLY when we are receiving messages. Before this PR, it was done always, which causes bad behavior for sync messages (imagine your Doctrine connection being closed in the middle of a controller or see https://github.com/symfony/symfony/pull/31334#issuecomment-544288437).

This fixes that in a pragmatic way: no new system for "worker-only" middleware or anything like that: just make the middleware smart enough to only do their work when a message is being received async.

Commits
-------

290a72917b Fixing issue where worker-only middleware were run in all contexts
2019-10-22 17:22:21 +02:00
Fabien Potencier
eaaabb6011 bug #34070 [ErrorRenderer] FlattenException cannot be final (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorRenderer] FlattenException cannot be final

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

Making it final forces tight coupling with the implementation as soon as one type-hints for the class.

That's a blocker on making e.g. `EasyAdminBundle` compatible with Symfony 5.

Commits
-------

b125835056 [ErrorRenderer] FlattenException cannot be final
2019-10-22 17:21:28 +02:00
Nicolas Grekas
b125835056 [ErrorRenderer] FlattenException cannot be final 2019-10-22 17:18:31 +02:00
Ryan Weaver
290a72917b Fixing issue where worker-only middleware were run in all contexts 2019-10-22 10:54:25 -04:00
Ryan Weaver
3d4e59a10b [Messenger] Removing "sync" transport and replacing it with much nicer config trick 2019-10-22 10:49:37 -04:00
Rimas Kudelis
8492e260cb Use port 465 for SES SMTP transport
Fixes #34064
2019-10-22 16:29:52 +03:00
Nicolas Grekas
e3261f4f7f [SecurityBundle] test with doctrine-bundle 2 2019-10-22 11:22:01 +02:00
Nicolas Grekas
5da67f9126 minor #34052 [HttpClient] skip tests implemented in 4.4 (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] skip tests implemented in 4.4

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

Needed after #34051 and #34044

Commits
-------

ae86ab18fa [HttpClient] skip tests implemented in 4.4
2019-10-22 08:53:15 +02:00
Nicolas Grekas
ec8e34f05e minor #34050 [VarDumper] improve displaying cut closures (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[VarDumper] improve displaying cut closures

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

Minor but still an improvement so 4.4: this change makes closures replaced by `CutStub` be displayed with their signature instead of just the `Closure` label.

Commits
-------

2b0a11de02 [VarDumper] improve displaying cut closures
2019-10-22 08:52:31 +02:00
Nicolas Grekas
ebca10e252 minor #34036 [Lock] Set ReturnType of LockFactory to LockInterface (alexander-schranz)
This PR was merged into the 4.4 branch.

Discussion
----------

[Lock] Set ReturnType of LockFactory to LockInterface

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

LockFactory I think should return a LockInterface and not the Lock class.

/cc @chalasr

Commits
-------

ff1fa57ef2 Set ReturnType of LockFactory to LockInterface
2019-10-22 08:44:12 +02:00
Nicolas Grekas
c86271e750 minor #34027 [EventDispatcher] handle lazy-callable invokable (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[EventDispatcher] handle lazy-callable invokable

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

Extracted from #34013, for consistency mostly.

Commits
-------

9df4c7d32b [EventDispatcher] handle lazy-callable invokable
2019-10-22 08:42:51 +02:00
Nicolas Grekas
5d097d2eb5 bug #34021 [TwigBridge] do not render errors for checkboxes twice (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[TwigBridge] do not render errors for checkboxes twice

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

Commits
-------

9eddea97d8 do not render errors for checkboxes twice
2019-10-22 08:41:35 +02:00
Nicolas Grekas
3d12e46692 [DI] made the %env(base64:...)% processor able to decode base64url 2019-10-22 08:40:11 +02:00
Nicolas Grekas
13e15e2112 bug #34017 [Messenger] Fix ignored options in redis transport (chalasr)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] Fix ignored options in redis transport

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

Also fixes redis authentication failure handling (inline with invalid db index handling, borrowed from symfony/cache).
/cc @alexander-schranz

Commits
-------

c83ff94c37 [Messenger] Fix ignored options in redis transport
2019-10-22 08:39:15 +02:00
Nicolas Grekas
f5cef028f8 Merge branch '4.3' into 4.4
* 4.3:
  Fix small typo in Exception message
2019-10-22 08:26:21 +02:00
Nicolas Grekas
afbbea3d1b Merge branch '3.4' into 4.3
* 3.4:
  Fix small typo in Exception message
2019-10-22 08:25:19 +02:00
Nicolas Grekas
bbafd76c6c bug #34055 [Console] Revert wrong change (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] Revert wrong change

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

This partially reverts #34012 as it breaks uses cases like this:

```
echo "foo\nbar\n" | SHELL_INTERACTIVE=1 symfony console something
```

Commits
-------

f592322251 [Console] Revert wrong change
2019-10-22 08:21:53 +02:00
Fabien Potencier
f592322251 [Console] Revert wrong change 2019-10-22 08:15:10 +02:00
Nicolas Grekas
ae86ab18fa [HttpClient] skip tests implemented in 4.4 2019-10-21 18:09:12 +02:00
Nicolas Grekas
e87301603e [HttpClient] allow option "buffer" to be a stream resource 2019-10-21 18:05:25 +02:00
Nicolas Grekas
2b0a11de02 [VarDumper] improve displaying cut closures 2019-10-21 17:47:54 +02:00
Yanick Witschi
bbb8ed11ff [HttpClient] Add a canceled state to the ResponseInterface 2019-10-21 17:46:23 +02:00
Menno Holtkamp
7c2b974e26 Fix small typo in Exception message 2019-10-21 17:42:36 +02:00
Fabien Potencier
16d528504c feature #33997 [FrameworkBundle] Add secrets:* commands and %env(secret:...)% processor to deal with secrets seamlessly (Tobion, jderusse, nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Add `secrets:*` commands and `%env(secret:...)%` processor to deal with secrets seamlessly

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #27351
| License       | MIT
| Doc PR        | symfony/symfony-docs/pull/11396

This PR continues #31101, please see there for previous discussions. The attached patch has been fine-tuned on https://github.com/nicolas-grekas/symfony/pull/33 with @jderusse.

This PR is more opinionated and thus a lot simpler than #31101: only Sodium is supported to encrypt/decrypt (polyfill possible), and only local filesystem is available as a storage, with little to no extension point. That's on purpose: the goal here is to provide an experience, not software building blocks. In 5.1, this might be extended and might lead to a new component, but we'd first need reports from real-world needs. Having this straight-to-the-point in 4.4 will allow gathering these needs (if they exist) and will immediately provide a nice workflow for the need we do want to solve now: forwarding secrets from dev to prod using git in a secure way.

The workflow this will allow is the following:
- public/private key pairs are generated in the `config/secrets/%kernel.environment%/` folder using `bin/console secrets:generate-keys`
- for the prod env, the corresponding private key should be deployed to the server using whatever means the hosting provider allows - this key MUST NOT be committed
- the public key is used to encrypt secrets and thus *may* be committed in the git repository to allow anyone *that can commit* to add secrets - this is done using `bin/console secrets:set`

DI configuration can reference secrets using `%env(secret:...)%` in e.g `services.yaml`.
There is also `bin/console secrets:remove` and `bin/console debug:secrets` to complete the toolbox.

In terms of design, vs #31101, this groups the dual "encoder" + "storage" concepts in a single "vault" one. That's part of what makes this PR simpler.

That's all folks :)

Commits
-------

c4653e1f65 Restrict secrets management to sodium+filesystem
02b5d740e5 Add secrets management
8c8f62390a Proof of concept for encrypted secrets
2019-10-20 21:11:11 +02:00
Fabien Potencier
c50d0b6d1c Merge branch '4.3' into 4.4
* 4.3:
  [HttpKernel] fix wrong removal of the just generated container dir
  bug #34024 [Routing] fix route loading with wildcard, but dir or file is empty (gseidel)
  [Routing] fix route loading with wildcard, but dir or file is empty
2019-10-20 14:38:12 +02:00
Fabien Potencier
5ce78ccbe1 Merge branch '3.4' into 4.3
* 3.4:
  [HttpKernel] fix wrong removal of the just generated container dir
2019-10-20 14:37:59 +02:00
Fabien Potencier
b38bde9cb1 bug #34041 [HttpKernel] fix wrong removal of the just generated container dir (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] fix wrong removal of the just generated container dir

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

The patch applies to 3.4 but the fix really affects to 4.4 with the introduction of the new `.preload.php` file.

/cc @fabpot since you encountered this error quite often recently during `composer up/req` :)

Commits
-------

4ad09ebafb [HttpKernel] fix wrong removal of the just generated container dir
2019-10-20 14:36:59 +02:00
Nicolas Grekas
4ad09ebafb [HttpKernel] fix wrong removal of the just generated container dir 2019-10-20 12:02:53 +02:00
Nicolas Grekas
c4653e1f65 Restrict secrets management to sodium+filesystem 2019-10-19 20:26:39 +02:00
Nicolas Grekas
568f4b4094 Merge branch '3.4' into 4.3
* 3.4:
  bug #34024 [Routing] fix route loading with wildcard, but dir or file is empty (gseidel)
2019-10-19 15:08:51 +02:00
Nicolas Grekas
a54ecb0fae bug #34024 [Routing] fix route loading with wildcard, but dir or file is empty (gseidel)
This PR was merged into the 4.3 branch.

Discussion
----------

[Routing] fix route loading with wildcard, but dir or file is empty

| Q             | A
| ------------- | ---
| Branch?       |  4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | no ticket i see so far
| License       | MIT

In my route config i have something like:

```yaml
empty_wildcard:
    resource: ../controller/empty_wildcard/*
    prefix: /empty_wildcard
```

But ``empty_wildcard`` is empty or has no route configured.

So i had this error:

``Call to a member function addPrefix() on null``

This PR take care if no route is configured, there will be no error.

Commits
-------

217058b475 [Routing] fix route loading with wildcard, but dir or file is empty
2019-10-19 15:07:56 +02:00
Nicolas Grekas
4bd16d884a bug #34024 [Routing] fix route loading with wildcard, but dir or file is empty (gseidel)
This PR was merged into the 4.3 branch.

Discussion
----------

[Routing] fix route loading with wildcard, but dir or file is empty

| Q             | A
| ------------- | ---
| Branch?       |  4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | no ticket i see so far
| License       | MIT

In my route config i have something like:

```yaml
empty_wildcard:
    resource: ../controller/empty_wildcard/*
    prefix: /empty_wildcard
```

But ``empty_wildcard`` is empty or has no route configured.

So i had this error:

``Call to a member function addPrefix() on null``

This PR take care if no route is configured, there will be no error.

Commits
-------

217058b475 [Routing] fix route loading with wildcard, but dir or file is empty
2019-10-19 15:04:41 +02:00
Gerhard Seidel
217058b475 [Routing] fix route loading with wildcard, but dir or file is empty 2019-10-19 15:03:42 +02:00
Christian Flothmann
d91b87f483 bump Form component compatibility versions 2019-10-19 10:26:53 +02:00
Christian Flothmann
ff904f3ac0 Merge branch '4.3' into 4.4
* 4.3:
  execute all compatible tests across versions
2019-10-19 10:25:26 +02:00
Christian Flothmann
18cc561754 execute all compatible tests across versions 2019-10-19 10:14:32 +02:00
Alexander Schranz
ff1fa57ef2
Set ReturnType of LockFactory to LockInterface 2019-10-18 21:16:41 +02:00
Maxime Steinhausser
197d1236ee [Mailer][MailchimpBridge] Don't send address names if empty string 2019-10-18 18:16:47 +02:00
Maxime Steinhausser
f14d082fad [Mailer][MailchimpBridge] Fix NamedAddress obsolete paths 2019-10-18 16:57:15 +02:00
Ivan
430ec32992 [ExpressionLanguage][Lexer] Exponential format for number
Exponential format has been added for numbers.
Ex: 1.99E+3 === 1990,
Ex: expression (1 + 1.99E+3) = 1991
2019-10-18 16:56:45 +03:00
Jérémy Derussé
02b5d740e5 Add secrets management 2019-10-18 14:46:38 +02:00
Tobias Schultze
8c8f62390a Proof of concept for encrypted secrets 2019-10-18 14:46:38 +02:00
Nicolas Grekas
ccb03650a2 [DI] add LazyString for lazy computation of string values injected into services 2019-10-18 14:17:42 +02:00
Nicolas Grekas
9df4c7d32b [EventDispatcher] handle lazy-callable invokable 2019-10-18 14:16:09 +02:00
Nicolas Grekas
f771faf925 Merge branch '4.3' into 4.4
* 4.3:
  [Dotenv] allow LF in single-quoted strings
  [Yaml] Throw exception for tagged invalid inline elements
  [Mailer] Fix Mandrill Transport API payload with named addresses
2019-10-18 13:24:32 +02:00
Nicolas Grekas
0b4c37a36c Merge branch '3.4' into 4.3
* 3.4:
  [Dotenv] allow LF in single-quoted strings
  [Yaml] Throw exception for tagged invalid inline elements
2019-10-18 13:23:15 +02:00
Fabien Potencier
a054d88830 bug #34023 [Dotenv] allow LF in single-quoted strings (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Dotenv] allow LF in single-quoted strings

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

in a shell:
```sh
FOO='bar
baz'
```

is legal to set a value to (in PHP):
```php
"bar\nbaz"
```

Commits
-------

4d79116a0d [Dotenv] allow LF in single-quoted strings
2019-10-18 13:17:48 +02:00
Nicolas Grekas
4d79116a0d [Dotenv] allow LF in single-quoted strings 2019-10-18 12:00:34 +02:00
Christian Flothmann
52f8fc839c bug #33818 [Yaml] Throw exception for tagged invalid inline elements (gharlan)
This PR was merged into the 3.4 branch.

Discussion
----------

[Yaml] Throw exception for tagged invalid inline elements

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

At the moment the result for `!foo 'don't do somthin' like that'` is a `TaggedValue` with value "don".

Commits
-------

bed479c561 [Yaml] Throw exception for tagged invalid inline elements
2019-10-18 11:15:32 +02:00
Christian Flothmann
9eddea97d8 do not render errors for checkboxes twice 2019-10-18 10:33:13 +02:00
Robin Chalas
c83ff94c37 [Messenger] Fix ignored options in redis transport 2019-10-17 20:40:26 +02:00
Fabien Potencier
4bd7cb0368 [Mailer] Fix SES Message Id retrieval 2019-10-17 16:20:58 +02:00