Commit Graph

41346 Commits

Author SHA1 Message Date
Robin Chalas dc95a6fec6 [Security] Fix argon2 availability checks 2019-04-08 18:18:02 +02:00
Fabien Potencier d935f40ed0 minor #31013 fix tests (xabbuh)
This PR was merged into the 4.3-dev branch.

Discussion
----------

fix tests

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

* use legacy group when using the deprecated `hinclude_default_template`
  templating config option
* conflict with DependencyInjection 4.2 in the HttpKernel component to
  be able to rely on five values being retrieved from the values of the
  `BoundArgument` class
* let the TwigBundle conflict with versions of FrameworkBundle that do
  not ship the `url_helper` service

Commits
-------

682855fa7d fix tests
2019-04-08 18:11:07 +02:00
Fabien Potencier 4e1244ecdb feature #30997 [Console] Add callback support to Console\Question autocompleter (Mikkel Paulson)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Console] Add callback support to Console\Question autocompleter

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | minor edge case, see below
| Deprecations? | no
| Tests pass?   | yes (with expanded coverage)
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | symfony/symfony-docs#11349

Autocompletion is a useful feature, but it's not always possible to anticipate every input the user could provide in advance. For instance, if we're allowing the user to input a path to a file, it's not practical to populate an array with every file and directory in the filesystem, but we can easily build a callback function that populates its suggestions based on the path already inputted.

This change replaces the autocomplete logic that accepts an array of suggestions with an architecture that uses a callback function to populate suggestions in real time as the user provides input.

The first commit adds a test class covering all methods of the `Question` object, while the second commit modifies the `Question` object to accept and store a callback function. The existing `[gs]etAutocompleterValues()` methods are preserved, but instead of being referenced directly from the `QuestionHelper`, they create and call their own callbacks to emulate the current behaviour.

There is one edge case that is changed, as documented in the test: when a `Traversable` object is passed to `setAutocompleterValues()`, the return value of `getAutocompleterValues()` will be the unpacked (array) form of that object rather than the object itself. The unpacking is done lazily and cached on the callback function.

Commits
-------

caad562c11 [Console] Add callback support to Console\Question autocompleter
2019-04-08 17:52:58 +02:00
Mikkel Paulson caad562c11 [Console] Add callback support to Console\Question autocompleter
In order to enable more dynamic use cases such as word-by-word
autocomplete and path-based autocomplete, update the autocomplete logic
of the Question object and its helper to accept a callback function.
This function is called on each keystroke and should return an array of
possibilities to present to the user.

The original logic only accepted an array, which required
implementations to anticipate in advance all possible input values.

This change is fully backwards-compatible, but reimplements the old
behaviour by initializing a "dumb" callback function that always returns
the same array regardless of input.
2019-04-08 17:48:46 +02:00
Christian Flothmann 682855fa7d fix tests
* use legacy group when using the deprecated `hinclude_default_template`
  templating config option
* conflict with DependencyInjection 4.2 in the HttpKernel component to
  be able to rely on five values being retrieved from the values of the
  `BoundArgument` class
* let the TwigBundle conflict with versions of FrameworkBundle that do
  not ship the `url_helper` service
2019-04-08 17:40:01 +02:00
Nicolas Grekas fa308e21eb minor #30978 [HttpClient] Allow the HTTP_PROXY environment variable lookup with phpdbg (theofidry)
This PR was squashed before being merged into the 4.3-dev branch (closes #30978).

Discussion
----------

[HttpClient] Allow the HTTP_PROXY environment variable lookup with phpdbg

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | N/A

`phpdbg` and `embed` are two other legit PHP SAPI's hence should be allowed.

Commits
-------

fbd439e0bd [HttpClient] Allow the HTTP_PROXY environment variable lookup with phpdbg
2019-04-08 17:24:46 +02:00
Théo FIDRY fbd439e0bd [HttpClient] Allow the HTTP_PROXY environment variable lookup with phpdbg 2019-04-08 17:24:39 +02:00
Christian Flothmann d56ebefa98 Merge branch '4.2'
* 4.2:
  fix buildTableRows when Colspan is use with content too long
  take setIgnoredAttributes() deprecation into account
2019-04-08 17:16:54 +02:00
Fabien Potencier 87c4cc1301 minor #31008 [FrameworkBundle] for Psr18HttpClient configuration (nicolas-grekas)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[FrameworkBundle] for Psr18HttpClient configuration

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

No need for autowiring actually here.

Commits
-------

bf89907dce [FrameworkBundle] for Psr18HttpClient configuration
2019-04-08 16:25:33 +02:00
Fabien Potencier c248646e59 bug #30852 [Console] fix buildTableRows when Colspan is use with content too long (Raulnet)
This PR was merged into the 4.2 branch.

Discussion
----------

[Console] fix buildTableRows when Colspan is use with content too long

| Q             | A
| ------------- | ---
| Branch?       |  4.2 for bug fixes
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes    ( new test added  TableTest::testWithColspanAndMaxWith)
| Fixed tickets |  https://github.com/symfony/symfony/issues/30701
| License       | MIT
| Doc PR        | no

<!-- fix for keeping ColumnMaxwith when Content is too long

Commits
-------

1cf9659b5f fix buildTableRows when Colspan is use with content too long
2019-04-08 16:23:48 +02:00
Nicolas Grekas bf89907dce [FrameworkBundle] for Psr18HttpClient configuration 2019-04-08 16:21:17 +02:00
Fabien Potencier f794e41544 minor #31005 [Serializer] take setIgnoredAttributes() deprecation into account (xabbuh)
This PR was merged into the 4.2 branch.

Discussion
----------

[Serializer] take setIgnoredAttributes() deprecation into account

| Q             | A
| ------------- | ---
| Branch?       | 4.2
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

4134be127a take setIgnoredAttributes() deprecation into account
2019-04-08 16:14:28 +02:00
Fabien Potencier 9d3c86fdb6 Merge branch '4.2'
* 4.2:
  [serializer] validate that the specified callbacks and max_depth_handler are actually callable
  [Serializer] Respect ignored attributes in cache key of normalizer
  fix resetting the COLUMN environment variable
  Fix TestRunner compatibility to PhpUnit 8
  Fix dark themed componnents
  prevent mixup of the object to populate
2019-04-08 16:11:46 +02:00
Fabien Potencier 08f24b0cae bug #30950 [Serializer] Also validate callbacks when given in the normalizer context (dbu)
This PR was merged into the 4.2 branch.

Discussion
----------

[Serializer] Also validate callbacks when given in the normalizer context

| Q             | A
| ------------- | ---
| Branch?       | 4.2 (callbacks are handled differently in 3.4)
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no (unless somebody relied on this bug ignoring `null` as callback
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | Related to #30888
| License       | MIT
| Doc PR        | -

callbacks configuration for the normalizer is validated to be valid callbacks when using setCallbacks or using the callbacks field in the default options. however, it was not validated when using the callbacks field in a context passed to `normalize()`

Commits
-------

37891525f7 [serializer] validate that the specified callbacks and max_depth_handler are actually callable
2019-04-08 16:10:15 +02:00
Fabien Potencier 35b1deda6b feature #30959 [FrameworkBundle] [TwigBundle] Move the hinclude key away from templating (Simperfit)
This PR was squashed before being merged into the 4.3-dev branch (closes #30959).

Discussion
----------

[FrameworkBundle] [TwigBundle] Move the hinclude key away from templating

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | yes <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #30874 <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | to do when pr is validated.

<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
 - Bug fixes must be submitted against the lowest 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 the master branch.
-->

Maybe I shouldn't move directly the config key from templating to the other, but since the templating component has been deprecated we may change this directly without deprecating that key alone, WDYT ?

Commits
-------

4f39339fec [FrameworkBundle] [TwigBundle] Move the hinclude key away from templating
2019-04-08 16:08:51 +02:00
Amrouche Hamza 4f39339fec [FrameworkBundle] [TwigBundle] Move the hinclude key away from templating 2019-04-08 16:08:42 +02:00
Raulnet 1cf9659b5f fix buildTableRows when Colspan is use with content too long 2019-04-08 15:40:54 +02:00
David Buchmann 37891525f7 [serializer] validate that the specified callbacks and max_depth_handler are actually callable 2019-04-08 15:09:58 +02:00
Christian Flothmann 4134be127a take setIgnoredAttributes() deprecation into account 2019-04-08 13:47:38 +02:00
Christian Flothmann ec41d76624 Merge branch '3.4' into 4.2
* 3.4:
  [Serializer] Respect ignored attributes in cache key of normalizer
  fix resetting the COLUMN environment variable
  Fix TestRunner compatibility to PhpUnit 8
  prevent mixup of the object to populate
2019-04-08 13:36:05 +02:00
Fabien Potencier 7a3060a867 bug #30907 [Serializer] Respect ignored attributes in cache key of normalizer (dbu)
This PR was squashed before being merged into the 3.4 branch (closes #30907).

Discussion
----------

[Serializer] Respect ignored attributes in cache key of normalizer

EUFOSSA

| Q             | A
| ------------- | ---
| Branch       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Do not share the attributes cache in object normalizer when using a different setting for the ignoredAttributes setting.

In Symfony 4.2, the setter is deprecated in favor of the ignored_attibutes option in the $context. When merging this up, we will however still need to respect the field as well for BC, the cache key does not look at the default context (apart from the deprecated modifiers, the default context is immutable)

There might be performance regression for some use cases, but also could be a performance improvement when using 'attributes' in the context with lists of objects of the same class.

Commits
-------

926d228877 [Serializer] Respect ignored attributes in cache key of normalizer
2019-04-08 12:10:13 +02:00
David Buchmann 926d228877 [Serializer] Respect ignored attributes in cache key of normalizer 2019-04-08 12:10:02 +02:00
Fabien Potencier d3eae71aa9 minor #31001 [Console] fix resetting the COLUMN environment variable (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console] fix resetting the COLUMN environment variable

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

8fb2074972 fix resetting the COLUMN environment variable
2019-04-08 12:06:32 +02:00
Christian Flothmann 8fb2074972 fix resetting the COLUMN environment variable 2019-04-08 11:29:13 +02:00
Fabien Potencier 9b9d416cf6 bug #30973 [WebProfiler] Fix Javascript error when using custom stopwatch categories (curry684)
This PR was squashed before being merged into the 4.3-dev branch (closes #30973).

Discussion
----------

[WebProfiler] Fix Javascript error when using custom stopwatch categories

Fixes #30745

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #30745
| License       | MIT

Made the getter do lazy creation so it can dynamically adapt to whatever it's given.

Commits
-------

e991472a76 [WebProfiler] Fix Javascript error when using custom stopwatch categories
2019-04-08 11:00:23 +02:00
Niels Keurentjes e991472a76 [WebProfiler] Fix Javascript error when using custom stopwatch categories 2019-04-08 11:00:04 +02:00
Nicolas Grekas d7a8b3d5e1 bug #30085 Fix TestRunner compatibility to PhpUnit 8 (alexander-schranz)
This PR was squashed before being merged into the 3.4 branch (closes #30085).

Discussion
----------

Fix TestRunner compatibility to PhpUnit 8

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | related to: #30055
| License       | MIT
| Doc PR        | -

Modify the installed phpunit version to be compatibility with the symfony custom TestRunner. This is sure not the best way but maybe currently the fastest way to support PhpUnit 8. The hack should be removed as soon as there is another way to implement a custom Runner.

Commits
-------

a0c66a399d Fix TestRunner compatibility to PhpUnit 8
2019-04-08 09:56:38 +02:00
Alexander Schranz a0c66a399d Fix TestRunner compatibility to PhpUnit 8 2019-04-08 09:56:31 +02:00
Fabien Potencier 0d786d3932 bug #30999 Fix dark themed componnents (ro0NL)
This PR was merged into the 4.2 branch.

Discussion
----------

Fix dark themed componnents

| Q             | A
| ------------- | ---
| Branch?       | 4.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | yes/no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Small follow up of #30860

![image](https://user-images.githubusercontent.com/1047696/55705391-f5070300-59de-11e9-8d7e-195ea74d17c3.png)

see https://github.com/symfony/symfony/issues/29194#issuecomment-437980830
___

![image](https://user-images.githubusercontent.com/1047696/55705263-b40eee80-59de-11e9-9503-ba4adf64857c.png)

see https://github.com/symfony/symfony/issues/29194#issuecomment-437998078

Commits
-------

d2f2e56472 Fix dark themed componnents
2019-04-08 09:23:34 +02:00
Roland Franssen d2f2e56472 Fix dark themed componnents 2019-04-08 09:12:55 +02:00
Fabien Potencier f539932899 fixed CS 2019-04-08 08:16:24 +02:00
Fabien Potencier fa7df09dbb feature #30968 [Security] Add Argon2idPasswordEncoder (chalasr)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Security] Add Argon2idPasswordEncoder

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #28093
| License       | MIT
| Doc PR        | TODO

Currently we have a `Argon2iPasswordEncoder` that may hash passwords using `argon2id` instead of `argon2i` (platform-dependent) which is not good.
This deprecates producing/validating `argon2id` hashed passwords using the `Argon2iPasswordEncoder`, and adds a `Argon2idPasswordEncoder` able to produce/validate `argon2id` hashed passwords only.

#EUFOSSA

Commits
-------

0c82173b24 [Security] Add Argon2idPasswordEncoder
2019-04-08 08:14:55 +02:00
Fabien Potencier b30f57e14b bug #30977 [serializer] prevent mixup in normalizer of the object to populate (dbu)
This PR was merged into the 3.4 branch.

Discussion
----------

[serializer] prevent mixup in normalizer of the object to populate

EUFOSSA

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

OBJECT_TO_POPULATE is meant to specify the top level object. The implementation left the option in the context and it would be used whenever we have the first element that matches the class. #30607 (to master) introduces the feature to also keep the instances of attributes to deeply populate an existing object tree. In both cases, we do not want the mix up to happen with what the current OBJECT_TO_POPULATE is.

Commits
-------

fdb668e051 prevent mixup of the object to populate
2019-04-08 08:05:24 +02:00
Fabien Potencier 5638d6adcc minor #30965 Prepare for the new serialization mechanism (fancyweb)
This PR was merged into the 4.3-dev branch.

Discussion
----------

Prepare for the new serialization mechanism

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

#eufossa

Should I maybe split this component by component ?

https://wiki.php.net/rfc/custom_object_serialization has been accepted.

Best viewed in "split" mode.

This work is kind of required for https://github.com/symfony/symfony/issues/30304 so we don't trigger 30 deprecations from our own code base.

Commits
-------

d412e77a9c Prepare for the new serialization mechanism
2019-04-08 08:01:37 +02:00
Fabien Potencier 35684187d5 bug #30995 [Mailer] allow user/pass on dsn while using failover/roundrobin (scuben)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Mailer] allow user/pass on dsn while using failover/roundrobin

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

this PR provides two things:
1. It is possible now to user `username` and `password` in a failover or round robin transport when using smtp
2. Fixed a type problem with `username` and `password` for the smtp transport as `getUsername()` cannot return `null` because of its signature but if no `username` is provided then the property would have been `null`. Fixed with setting an empty string as default. Same for `password`. (This was discovered by adding a test - yeah!)

Commits
-------

4518ac56a1 allow user/pass on dns while using failover/roundrobin and type fix for username/password
2019-04-08 07:54:46 +02:00
Fabien Potencier e02cbe918a Merge branch '4.2'
* 4.2:
  Make tests independent from each other
2019-04-08 07:24:03 +02:00
Fabien Potencier bbad6e8e58 Merge branch '3.4' into 4.2
* 3.4:
  Make tests independent from each other
2019-04-08 07:23:45 +02:00
Fabien Potencier 48bb7c999c minor #30986 Make tests independent from each other (greg0ire)
This PR was merged into the 3.4 branch.

Discussion
----------

Make tests independent from each other

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

Environment variables set in a test need to be restored to their
previous values or unset if we want to be able to run tests
independently.

Credits to @ostrolucky for spotting this issue, I'm available for help when merging this in more recent branch (issues may appear then).

Created during the EU-FOSSA hackathon

Commits
-------

00883fc409 Make tests independent from each other
2019-04-08 07:17:37 +02:00
Fabien Potencier 546b1146c4 fixed CS 2019-04-08 07:16:00 +02:00
Fabien Potencier 02e865b298 bug #30992 [TwigBridge][DependencyInjection] ignore null arguments (xabbuh)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[TwigBridge][DependencyInjection] ignore null arguments

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

44eb7a0485 fix backwards compatibility breaks
2019-04-08 07:15:29 +02:00
Nicolas Grekas 408e4aa48e bug #30990 Allow env processor to resolve `::` (jderusse)
This PR was merged into the 4.3-dev branch.

Discussion
----------

Allow env processor to resolve `::`

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

The env processor resolve to null when no fallback are provided. ie. `env(default::NOT_EXISTS)`

Issue is that the regexp does not allow such pattern. thus made the feature unusable.

Commits
-------

6b6c24c618 Allow env processor to resolve `::`
2019-04-07 23:36:42 +02:00
Christian Flothmann 44eb7a0485 fix backwards compatibility breaks 2019-04-07 23:31:58 +02:00
Grégoire Paris 00883fc409
Make tests independent from each other
Environment variables set in a test need to be restored to their
previous values or unset if we want to be able to run tests
independently.
2019-04-07 23:05:09 +02:00
Patrick Landolt 4518ac56a1 allow user/pass on dns while using failover/roundrobin and type fix for username/password 2019-04-07 22:39:37 +02:00
Jérémy Derussé 6b6c24c618
Allow env processor to resolve `::` 2019-04-07 22:36:28 +02:00
Christian Flothmann 2efd7b2149 Merge branch '4.2'
* 4.2:
  fix tests
  fix PHPUnit 4.8 compatibility
  [Debug] Fixed error handling when an error is already handled when another error is already handled (5)
  sync validator translations
2019-04-07 21:49:19 +02:00
Christian Flothmann 5b8a68d98d minor #30989 fix tests (xabbuh)
This PR was merged into the 4.2 branch.

Discussion
----------

fix tests

| Q             | A
| ------------- | ---
| Branch?       | 4.2
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

27df966705 fix tests
2019-04-07 21:42:46 +02:00
Robin Chalas 0c82173b24 [Security] Add Argon2idPasswordEncoder 2019-04-07 21:35:55 +02:00
Christian Flothmann 27df966705 fix tests 2019-04-07 21:30:26 +02:00
Thomas Calvet d412e77a9c Prepare for the new serialization mechanism 2019-04-07 20:20:37 +02:00