Commit Graph

36546 Commits

Author SHA1 Message Date
Robin Chalas
b972d15d52 bug #29863 [Security] Do not mix password_*() API with libsodium one (chalasr)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security] Do not mix password_*() API with libsodium one

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

Argon2IPasswordEncoder uses native `password_hash()` and `password_verify()` functions if the current PHP installation embeds Argon2 support (>=7.2, compiled `--with-password-argon2`).
Otherwise, it fallbacks to the libsodium extension.

This was fine at time the encoder was introduced, but meanwhile libsodium changed the algorithm used by `sodium_crypto_pwhash_str()` which is now argon2id, that goes outside of the scope of the encoder which was designed to deal with `argon2i` only.
Nothing we can do as databases may already contain passwords hashed with argon2id, the encoder must keep validating those.

However, the PHP installation may change as time goes by, and could suddenly embed the Argon2 core integration. In this case, the encoder would use the `password_verify()` function which would fail in case the password was not hashed using argon2i.
This PR prevents it by detecting that argon2id was used, avoiding usage of `password_verify()`.

See https://github.com/jedisct1/libsodium-php/issues/194 and https://github.com/symfony/symfony/issues/28093 for references.
Patch cannot be tested as it is platform dependent.

Side note: I'm currently working on a new implementation for 4.3 that will properly supports argon2id (which has been added to the PHP core sodium integration in 7.3) and argon2i, distinctively.

Commits
-------

d6cfde94b4 [Security] Do not mix usage of password_*() functions and sodium_*() ones
2019-01-18 19:41:49 +01:00
Mathieu Lechat
2791edf1fb [Form] Changed UrlType input type to text when default_protocol is not null 2019-01-18 10:39:23 +01:00
Thomas Calvet
c3b670a908 [Debug][DebugClassLoader] Match more cases for final, deprecated and internal classes / methods extends 2019-01-17 18:28:22 +01:00
Fabien Potencier
e231edd5dc minor #29914 ensure compatibility with older PHPUnit mocks (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

ensure compatibility with older PHPUnit mocks

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

Commits
-------

b714419faf ensure compatibility with older PHPUnit mocks
2019-01-17 14:52:57 +01:00
Christian Flothmann
b714419faf ensure compatibility with older PHPUnit mocks 2019-01-17 09:49:40 +01:00
Fabien Potencier
b6b59769b9 minor #29903 Move from array() to [] (fabpot)
This PR was squashed before being merged into the 3.4 branch (closes #29903).

Discussion
----------

Move from array() to []

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| 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

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

Commits
-------

37ab4cd056 fixed CS
1429267f9c fixed short array CS in comments
25240831e2 fixed CS in ExpressionLanguage fixtures
ec7dcb2784 fixed CS in generated files
afaa13e946 fixed CS on generated container files
7ffd8d3e03 fixed CS on Form PHP templates
0ba1acc82f fixed CS on YAML fixtures
ac9d6cff81 fixed fixtures
33a001e460 switched array() to []
2019-01-16 15:25:07 +01:00
Fabien Potencier
37ab4cd056 fixed CS 2019-01-16 14:43:35 +01:00
Fabien Potencier
1429267f9c fixed short array CS in comments 2019-01-16 14:27:11 +01:00
Fabien Potencier
25240831e2 fixed CS in ExpressionLanguage fixtures 2019-01-16 13:52:19 +01:00
Fabien Potencier
ec7dcb2784 fixed CS in generated files 2019-01-16 13:48:01 +01:00
Fabien Potencier
afaa13e946 fixed CS on generated container files 2019-01-16 13:30:46 +01:00
Fabien Potencier
7ffd8d3e03 fixed CS on Form PHP templates 2019-01-16 12:03:13 +01:00
Fabien Potencier
0ba1acc82f fixed CS on YAML fixtures 2019-01-16 11:59:17 +01:00
Fabien Potencier
ac9d6cff81 fixed fixtures 2019-01-16 11:05:08 +01:00
Fabien Potencier
33a001e460 switched array() to [] 2019-01-16 10:39:14 +01:00
Fabien Potencier
c7f46e4795 minor #29892 [TwigBridge] remove unreachable code (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[TwigBridge] remove unreachable code

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

Since our version constraint is `^1.37.1|^2.6.2` any Twig version that
is below 2.4.5 must be a Twig 1.x release.

Commits
-------

16f97b9769 remove unreachable code
2019-01-16 09:32:02 +01:00
Fabien Potencier
0f0c30a1c3 bug #29894 [DependencyInjection] the string "0" is a valid service identifier (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[DependencyInjection] the string "0" is a valid service identifier

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

Commits
-------

caca373383 the string "0" is a valid service identifier
2019-01-15 15:10:59 +01:00
Christian Flothmann
caca373383 the string "0" is a valid service identifier 2019-01-15 14:43:24 +01:00
Christian Flothmann
16f97b9769 remove unreachable code
Since our version constraint is `^1.37.1|^2.6.2` any Twig version that
is below 2.4.5 must be a Twig 1.x release.
2019-01-15 14:09:02 +01:00
Fabien Potencier
7789a99968 bug #29885 Update MimeType extensions (fabpot)
This PR was merged into the 3.4 branch.

Discussion
----------

Update MimeType extensions

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| 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

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

Commits
-------

5183049b73 updated MimeType extensions
2019-01-14 18:53:36 +01:00
Fabien Potencier
5183049b73 updated MimeType extensions 2019-01-14 18:38:02 +01:00
Fabien Potencier
f41f6c39cb minor #29880 [TwigBridge] bump required Twig version (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[TwigBridge] bump required Twig version

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | twigphp/Twig#2810
| License       | MIT
| Doc PR        |

Commits
-------

37e8ccba0f bump required Twig version
2019-01-14 16:28:50 +01:00
Christian Flothmann
37e8ccba0f bump required Twig version 2019-01-14 16:05:06 +01:00
Fabien Potencier
facbaa52dc bug #29875 [TwigBridge] fix compatibility with Twig >= 2.6.1 (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[TwigBridge] fix compatibility with Twig >= 2.6.1

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

Commits
-------

40089fb28f fix compatibility with Twig >= 2.6.1
2019-01-14 11:50:45 +01:00
Christian Flothmann
40089fb28f fix compatibility with Twig >= 2.6.1 2019-01-14 11:10:57 +01:00
Fabien Potencier
51d4ca3756 minor #29864 [Form] SA fix (ro0NL)
This PR was squashed before being merged into the 3.4 branch (closes #29864).

Discussion
----------

[Form] SA fix

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| 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 -->

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

Commits
-------

1c85707946 [Form] SA fix
2019-01-14 10:46:03 +01:00
Roland Franssen
1c85707946 [Form] SA fix 2019-01-14 10:45:52 +01:00
Fabien Potencier
d0bf01ea53 minor #29874 [CssSelector] fix compatibility with PHPUnit 4.8 (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[CssSelector] fix compatibility with PHPUnit 4.8

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

Commits
-------

189da22528 fix compatibility with PHPUnit 4.8
2019-01-14 10:29:25 +01:00
Christian Flothmann
189da22528 fix compatibility with PHPUnit 4.8 2019-01-14 10:12:36 +01:00
Fabien Potencier
057890d41e bug #29873 [Debug] remove return type hint for PHP 5 compatibility (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Debug] remove return type hint for PHP 5 compatibility

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

Commits
-------

1f31471ffe remove return type hint for PHP 5 compatibility
2019-01-14 09:59:05 +01:00
Christian Flothmann
1f31471ffe remove return type hint for PHP 5 compatibility 2019-01-14 09:43:48 +01:00
Fabien Potencier
3ea4901516 bug #29837 Fix SwiftMailerHandler to support Monolog's latest reset functionality (Seldaek)
This PR was merged into the 3.4 branch.

Discussion
----------

Fix SwiftMailerHandler to support Monolog's latest reset functionality

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

Monolog 1.24 added the ResettableInterface which is meant to support resetting handlers. Reset should also flush as if the request was ending, and it can be used for long running workers for example in between each job that is processed. Due to SwiftMailer's spool however the emails in case of errors are right now only sent at the very end of the worker's lifetime.

For older Monolog versions, this will be ignored, and is thus harmless.

Commits
-------

ada2d83b67 Fix SwiftMailerHandler to support Monolog's latest reset functionality
2019-01-13 17:54:10 +01:00
Fabien Potencier
b06967e64f minor #29798 Component CssSelector tests (vladis84)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #29798).

Discussion
----------

Component CssSelector tests

| 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? | no
| Tests pass?   | yes
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

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

Commits
-------

c7410bef29 Component CssSelector tests
2019-01-13 17:50:42 +01:00
Gordienko Vladislav
c7410bef29 Component CssSelector tests 2019-01-13 17:50:36 +01:00
Fabien Potencier
ea68e28cf0 bug #29853 Revert "bug #29597 [DI] fix reporting bindings on overriden services as unused" (mmarynich)
This PR was merged into the 3.4 branch.

Discussion
----------

Revert "bug #29597 [DI] fix reporting bindings on overriden services as unused"

This reverts commit 44e9a91f30, reversing
changes made to 91b28ff081.

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

4.2.2 release changed the way tagged service are injected

As asked by @nicolas-grekas https://github.com/symfony/symfony/issues/29836#issuecomment-453464500

Commits
-------

b3e17d2101 Revert "bug #29597 [DI] fix reporting bindings on overriden services as unused (nicolas-grekas)"
2019-01-13 17:45:27 +01:00
Fabien Potencier
6573cd35b4 minor #29849 [Validator] Fixed exception wording (vudaltsov)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Fixed exception wording

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

Commits
-------

8266262c9c Fixed exception wording
2019-01-13 17:39:55 +01:00
Fabien Potencier
37c6ae8923 bug #29833 [DebugClassLoader] expose proxyfied findFile() method (fancyweb)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #29833).

Discussion
----------

[DebugClassLoader] expose proxyfied findFile() method

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

As bad as it is, some third party libraries expect that at least one autoload function will be the Composer one and have behaviors that relies on the public `findFile` method.

When the `DebugClassLoader` wraps the Composer `ClassLoader`, the function `findFile` is currently lost. So it becomes impossible to use the `DebugClassLoader` with these libraries.

This is for example the case in Drupal 😢 (cf 83bc30ac40/lib/Drupal/Component/ClassFinder/ClassFinder.php).

Fixing these bad implementations in third party libraries can take forever as things move way slower than in Symfony. This is why I think supporting this case directly in Symfony is better. It's easy and will make the `DebugClassLoader` compatible with more cases.

What could be done to go further in this direction would be to proxify any method implementend by wrapped class loaders.

Commits
-------

4f690a31c6 [DebugClassLoader] Readd findFile() method
2019-01-13 17:36:53 +01:00
Thomas Calvet
4f690a31c6 [DebugClassLoader] Readd findFile() method 2019-01-13 17:36:47 +01:00
Fabien Potencier
78e6f28f67 minor #29860 [Console] Fix composer.json suggest/provide (chalasr)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console] Fix composer.json suggest/provide

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

For using the ConsoleLogger you need to require psr/log, not a psr/log-implementation given ConsoleLogger is an implem.

Commits
-------

4db43f3e76 [Console] Fix composer.json suggest/provide
2019-01-12 13:18:00 +01:00
Robin Chalas
4db43f3e76 [Console] Fix composer.json suggest/provide 2019-01-12 12:06:42 +01:00
Robin Chalas
d6cfde94b4 [Security] Do not mix usage of password_*() functions and sodium_*() ones 2019-01-12 03:20:20 +01:00
Mikhail Marynich
b3e17d2101 Revert "bug #29597 [DI] fix reporting bindings on overriden services as unused (nicolas-grekas)"
This reverts commit 44e9a91f30, reversing
changes made to 91b28ff081.
2019-01-11 16:53:30 +01:00
Christian Flothmann
497309a20f minor #29829 [TwigBridge] account for the short array syntax in Twig (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[TwigBridge] account for the short array syntax in Twig

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

59a4dc609d account for the short array syntax in Twig
2019-01-11 15:06:55 +01:00
Valentin
8266262c9c Fixed exception wording 2019-01-11 17:00:45 +03:00
Jordi Boggiano
ada2d83b67
Fix SwiftMailerHandler to support Monolog's latest reset functionality 2019-01-10 16:10:12 +01:00
Christian Flothmann
59a4dc609d account for the short array syntax in Twig 2019-01-10 09:15:17 +01:00
Fabien Potencier
a5c52b81f2 minor #29815 [Console] Fix phpdoc for InputOption shortcut (tvlooy)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #29815).

Discussion
----------

[Console] Fix phpdoc for InputOption shortcut

symfony documentation tells people to pass null, and it is the default, but the method docs don't allow it so static analyzers complain about it (spotted by phan)

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

Commits
-------

64a65e9cd1 Fix docs
2019-01-09 19:02:33 +01:00
Tom Van Looy
64a65e9cd1 Fix docs
symfony documentation tells people to pass null, and it is the default, but the method docs don't allow it so static analyzers complain about it (spotted by phan)
2019-01-09 19:02:24 +01:00
Fabien Potencier
3245cb48da enabled short array notation in CS 2019-01-08 09:38:39 +01:00
Fabien Potencier
cb07a3b551 minor #29811 [fabbot] enable short arrays (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[fabbot] enable short arrays

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

Let's move to short arrays, but let's do it in a smooth way.
This PR enables short arrays for php-cs-fixer, making PRs red when they don't follow the CS.
We should then ask all authors of pending PRs to rebase their PR and apply the CS patch.
This will need some time.
Then, in 1-2 months, we'll be able to move all the code base to short arrays without creating hundred merge conflicts with all pending PRs, hopefully.

Commits
-------

84e72e0061 [fabbot] enable short arrays
2019-01-08 08:25:04 +01:00