Commit Graph

54626 Commits

Author SHA1 Message Date
Nicolas Grekas
8ef49cf3b3 feature #41161 [HttpClient] Add DecoratorTrait to ease writing simple decorators (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[HttpClient] Add `DecoratorTrait` to ease writing simple decorators

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

Commits
-------

46821708b0 [HttpClient] Add `DecoratorTrait` to ease writing simple decorators
2021-05-10 16:44:53 +02:00
Nicolas Grekas
46821708b0 [HttpClient] Add DecoratorTrait to ease writing simple decorators 2021-05-10 16:44:17 +02:00
Nicolas Grekas
252ee3975e Merge branch '5.2' into 5.x
* 5.2:
  [Inflector][String] wrong plural form of words ending by "pectus"
  [HttpClient] Don't prepare the request in ScopingHttpClient
  [Console] Fixes for PHP 8.1 deprecations
  Make LoginRateLimiter case insentive
  Fix/Rewrite .gitignore regex builder
  Reset limiters on successful login
  Provide count argument for TooManyLoginAttemptsAuthenticationException to be able to translate in plural way
  [security] NullToken signature
2021-05-10 16:42:11 +02:00
Nicolas Grekas
4f70f61cf8 Merge branch '4.4' into 5.2
* 4.4:
  [Inflector][String] wrong plural form of words ending by "pectus"
  [HttpClient] Don't prepare the request in ScopingHttpClient
  [Console] Fixes for PHP 8.1 deprecations
  Fix/Rewrite .gitignore regex builder
2021-05-10 16:39:23 +02:00
Nicolas Grekas
9c9e645e87 bug #41147 [Inflector][String] wrong plural form of words ending by "pectus" (makraz)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Inflector][String] wrong plural form of words ending by "pectus"

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

Commits
-------

0dc8893caa [Inflector][String] wrong plural form of words ending by "pectus"
2021-05-10 16:36:02 +02:00
Hamza Makraz
0dc8893caa [Inflector][String] wrong plural form of words ending by "pectus" 2021-05-10 16:35:56 +02:00
Nicolas Grekas
21bf85f802 minor #41157 [Console] Fixes for PHP 8.1 deprecations (jrmajor)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] Fixes for PHP 8.1 deprecations

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

Fixes passing `null` to non-nullable arguments.

Commits
-------

545f058367 [Console] Fixes for PHP 8.1 deprecations
2021-05-10 16:34:29 +02:00
Nicolas Grekas
132e09fb00 bug #41160 [HttpClient] Don't prepare the request in ScopingHttpClient (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] Don't prepare the request in ScopingHttpClient

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

Spotted while working on #41159 (needed by it.)

Commits
-------

a53db83823 [HttpClient] Don't prepare the request in ScopingHttpClient
2021-05-10 16:33:49 +02:00
Nicolas Grekas
a53db83823 [HttpClient] Don't prepare the request in ScopingHttpClient 2021-05-10 16:26:32 +02:00
Wouter de Jong
1ba1305ef1 bug #41156 [Security] Make Login Rate Limiter case insensitive (jderusse)
This PR was merged into the 5.2 branch.

Discussion
----------

[Security] Make Login Rate Limiter case insensitive

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

Login RateLimiter is case sensitive, while most login forms aren't case sensitive.
This PR makes `DefaultLoginRateLimiter` case insensitive.

Commits
-------

c333f3d547 Make LoginRateLimiter case insentive
2021-05-10 15:18:33 +02:00
Jeremiasz Major
545f058367
[Console] Fixes for PHP 8.1 deprecations 2021-05-10 14:53:15 +02:00
Fabien Potencier
90ab9edd47 bug #41155 [Translation] Improved Translation Providers (welcoMattic)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Translation] Improved Translation Providers

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

Some small improvements on Translation Providers:
- move symfony/config from dev dependency to hard dependency for all Bridges as all providers use XliffFileLoader to load pulled translations (cf. https://github.com/symfony/symfony/pull/40927#issuecomment-836569888)
- replace all instances of
```
'headers' => [
    'Authorization' => 'Bearer API_TOKEN',
]
```
with `'auth_bearer' => 'API_TOKEN',` even in tests files.
- Fix Lokalise base_uri concatenation

Commits
-------

84fd13ce95 Improved Translation Providers
2021-05-10 14:50:12 +02:00
Jérémy Derussé
c333f3d547
Make LoginRateLimiter case insentive 2021-05-10 14:44:29 +02:00
Mathieu Santostefano
84fd13ce95
Improved Translation Providers 2021-05-10 14:27:24 +02:00
Fabien Potencier
0b66008af2 feature #40927 [Translation] Added Lokalise Provider (welcoMattic)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Translation] Added Lokalise Provider

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

To follow up on https://github.com/symfony/symfony/pull/38475, this PR adds [Lokalise](https://lokalise.com/) Provider.

The todo list to make it ready is:

- [x] Apply recent changes that have been made on `ProviderInterface` and `TranslatorBagInterface` (we removed the `all()` and `getDomains()` method from TranslatorBagInterface)
- [x] Add LokaliseProvider to `src/Symfony/Bundle/FrameworkBundle/Resources/config/translation_providers.php` file
- [x] Add Lokalise case to `Symfony\Component\Translation\Exception\UnsupportedSchemeException`
- [x] Move `LokaliseProvider` and `LokaliseProviderFactory` from `Symfony\Component\Translation\Bridge\Lokalise\Provider` to `Symfony\Component\Translation\Bridge\Lokalise` namespace
- [x] Write integration tests by mocking HTTP Responses

The major part of the remaining work concerns tests, I will make it done before the beginning of May.

Commits
-------

022d8285f3 Added Lokalise Provider
2021-05-10 12:48:12 +02:00
Mathieu Santostefano
022d8285f3
Added Lokalise Provider 2021-05-10 12:15:27 +02:00
Fabien Potencier
af19b6bec2 feature #40926 [Translation] Added PoEditor Provider (welcoMattic)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Translation] Added PoEditor Provider

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

To follow up on https://github.com/symfony/symfony/pull/38475, this PR adds [PoEditor](https://poeditor.com/) Provider.

The todo list to make it ready is:

- [x] Apply recent changes that have been made on `ProviderInterface` and `TranslatorBagInterface` (we removed the `all()` and `getDomains()` method from TranslatorBagInterface)
- [x] Add PoEditorProvider to `src/Symfony/Bundle/FrameworkBundle/Resources/config/translation_providers.php` file
- [x] Add PoEditor case to `Symfony\Component\Translation\Exception\UnsupportedSchemeException`
- [x] Write integration tests by mocking HTTP Responses

The major part of the remaining work concerns tests, I will make it done before the beginning of May.

Commits
-------

240ac22f70 Added PoEditor Provider
2021-05-10 12:12:59 +02:00
Mathieu Santostefano
240ac22f70
Added PoEditor Provider 2021-05-10 11:59:26 +02:00
Nicolas Grekas
7c43648d93 bug #41137 [Security] Reset limiters on successful login (MatTheCat)
This PR was merged into the 5.2 branch.

Discussion
----------

[Security] Reset limiters on successful login

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

Commits
-------

aa295a48b0 Reset limiters on successful login
2021-05-10 11:00:08 +02:00
Nicolas Grekas
c151f76b02 bug #41148 [Runtime] fix defining $_SERVER[APP_ENV] (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Runtime] fix defining $_SERVER[APP_ENV]

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

Commits
-------

e271accc12 [Runtime] fix defining $_SERVER[APP_ENV]
2021-05-10 10:53:17 +02:00
Nicolas Grekas
2a87821d21 minor #41146 [Translation] improve CrowdinProvider (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Translation] improve CrowdinProvider

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

Commits
-------

9c3c186da8 [Translation] improve CrowdinProvider
2021-05-10 10:51:38 +02:00
Nicolas Grekas
9c3c186da8 [Translation] improve CrowdinProvider 2021-05-10 10:39:41 +02:00
Fabien Potencier
a04dedd6c3 minor #41145 Fix style of changelogs/readmes (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

Fix style of changelogs/readmes

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

Commits
-------

a964554538 Fix style of changelogs/readmes
2021-05-10 09:03:15 +02:00
Wouter de Jong
2a7b85dc78 minor #41134 [Security] Translation count argument for TooManyLoginAttemptsAuthenticationException (rmikalkenas)
This PR was merged into the 5.2 branch.

Discussion
----------

[Security] Translation count argument for TooManyLoginAttemptsAuthenticationException

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

Added `%count%` argument to leverage translator's pluralization functionality as discussed in https://github.com/symfony/symfony/pull/41097

Commits
-------

2bf0b485f9 Provide count argument for TooManyLoginAttemptsAuthenticationException to be able to translate in plural way
2021-05-09 23:28:00 +02:00
Nicolas Grekas
e271accc12 [Runtime] fix defining $_SERVER[APP_ENV] 2021-05-09 19:16:51 +02:00
Fabien Potencier
e7a5a2c86c Bump Symfony version to 5.3.0 2021-05-09 18:29:50 +02:00
Nicolas Grekas
a964554538 Fix style of changelogs/readmes 2021-05-09 18:18:06 +02:00
Fabien Potencier
f6ab4b5b26
Merge pull request #41144 from fabpot/release-5.3.0-BETA3
released v5.3.0-BETA3
2021-05-09 18:06:35 +02:00
Fabien Potencier
b30f848e1d Update VERSION for 5.3.0-BETA3 2021-05-09 18:06:21 +02:00
Fabien Potencier
33304cc411 Update CHANGELOG for 5.3.0-BETA3 2021-05-09 18:06:12 +02:00
Fabien Potencier
6bfb509378 feature #40947 [Translation] Added Crowdin Translation Provider (andrii-bodnar)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Translation] Added Crowdin Translation Provider

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |  <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | <!-- required for new features -->

To follow up on #38475, this PR adds [Crowdin](https://crowdin.com/) Provider.
This provider was removed a few weeks ago from the Translation Providers feature by `@welcoMattic`.

We discussed all the recent changes made on `ProviderInterface`, `TranslatorBagInterface`, and others and I already applied these changes to Crowdin Provider.

Also, this Provider is adapted to work with both [Crowdin](https://crowdin.com/) and [Crowdin Enterprise](https://crowdin.com/enterprise).

The todo list to make it ready is:
- [x] Write integration tests by mocking HTTP Responses

I will make it done before the beginning of May.

Commits
-------

d7fda16262 [Translation] Added Crowdin Translation Provider
2021-05-09 17:52:59 +02:00
Andrii Bodnar
d7fda16262 [Translation] Added Crowdin Translation Provider 2021-05-09 17:52:54 +02:00
Fabien Potencier
1e9efea89b minor #41116 [Translation] Refactored LocoProvider (welcoMattic)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Translation] Refactored LocoProvider

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

I've refactored the LocoProviderTest class to use properly `MockResponse` instead and creating mock of `ResponseInterface` and make useless assertions.
I've also refactored the Provider itself to get benefit of HttpClient concurrency.
It allows me to find 2 bugs, which are fixed. They concerns the usage of internal unique ids provided by Loco to update/delete translations, instead of translation files keys (which are not unique across a Symfony application).
Finally I've added a test for the `delete` method.

Ready for first review

Commits
-------

40041db7cb Refactored LocoProviderTest
2021-05-09 17:50:31 +02:00
Fabien Potencier
3c7662507d minor #40930 [DependencyInjection] Better exception when a configurator is not type hinted (lyrixx)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[DependencyInjection] Better exception when a configurator is not type hinted

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

This would help with such BC break:
https://github.com/markitosgv/JWTRefreshTokenBundle/pull/241

Commits
-------

25813e3804 [DependencyInjection] Better exception when a configurator is not type hinted
2021-05-09 17:44:29 +02:00
Robin Chalas
799775a459
bug #40758 [Security] NullToken signature (jderusse)
This PR was merged into the 5.2 branch.

Discussion
----------

[Security] NullToken signature

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

The signature of `TokenInterface::getUser` does not allow returning null. But `NullToken` returns `null`.
0f96ac7484/src/Symfony/Component/Security/Core/Authentication/Token/TokenInterface.php (L49-L56)

This PR update `NullToken::getUser` to return an empty string instead of null.
I wonder if the fix shouldn't be to change the return type in the interface, but that would be a BC break, right?

Commits
-------

9ad3720efc [security] NullToken signature
2021-05-09 14:23:42 +02:00
Robin Chalas
10ced7ab80
minor #41131 [Serializer] Fix duplicated legacy test (chalasr)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Serializer] Fix duplicated legacy test

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

Probably accidentally kept in https://github.com/symfony/symfony/pull/40710

Commits
-------

19e5650c25 Fix duplicated legacy test
2021-05-09 14:05:26 +02:00
Fabien Potencier
be480d8f97 bug #40763 Fix/Rewrite .gitignore regex builder (mvorisek)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

Fix/Rewrite .gitignore regex builder

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

This PR fixes `.gitignore` with exclude wildcard ignore rules like `!a/*/b` were failing with `preg_match(): Compilation failed: lookbehind assertion is not fixed length at offset` PHP error.

Functionality/performance was verified against large `.gitignore` files:
- https://github.com/PrestaShop/PrestaShop/blob/1.7.7.3/.gitignore
- https://github.com/dotnet/installer/blob/v5.0.202/.gitignore
- https://github.com/dotnet/runtime/blob/v5.0.5/.gitignore

This PR also improves the testing cases.

Commits
-------

83f9fd3adf Fix/Rewrite .gitignore regex builder
2021-05-09 11:13:17 +02:00
Michael Voříšek
83f9fd3adf Fix/Rewrite .gitignore regex builder 2021-05-09 11:13:09 +02:00
MatTheCat
aa295a48b0
Reset limiters on successful login 2021-05-08 12:10:42 +02:00
Rokas Mikalkėnas
2bf0b485f9 Provide count argument for TooManyLoginAttemptsAuthenticationException to be able to translate in plural way 2021-05-08 11:47:35 +03:00
Robin Chalas
19e5650c25
Fix duplicated legacy test 2021-05-08 01:41:33 +02:00
Mathieu Santostefano
40041db7cb
Refactored LocoProviderTest 2021-05-08 00:06:08 +02:00
Robin Chalas
ad91659ea9 bug #41132 [Runtime] don't display the shebang on the CLI (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Runtime] don't display the shebang on the CLI

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

Commits
-------

463b2db51b [Runtime] dont display the shebang on the CLI
2021-05-07 23:48:57 +02:00
Nicolas Grekas
463b2db51b [Runtime] dont display the shebang on the CLI 2021-05-07 20:12:19 +02:00
Nicolas Grekas
e03ab57139 Merge branch '5.2' into 5.x
* 5.2:
  [Console] hotfix
2021-05-07 16:48:44 +02:00
Nicolas Grekas
3bac7fef07 [Console] hotfix 2021-05-07 16:48:34 +02:00
Nicolas Grekas
173cf480eb minor #41115 [WebProfilerBundle] Add simple backoff strategy on 404 (loevgaard)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[WebProfilerBundle] Add simple backoff strategy on 404

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

Instead of just retrying every second 5 times, this PR implements a very basic backoff strategy where it waits 1, 1, 2, 3, 5 seconds between the respective requests instead which amounts to a total wait of 12 seconds instead of 5.

Commits
-------

f1b9684ebd [WebProfilerBundle] Add simple backoff strategy on 404
2021-05-07 16:43:44 +02:00
Joachim Løvgaard
f1b9684ebd [WebProfilerBundle] Add simple backoff strategy on 404 2021-05-07 16:43:39 +02:00
Nicolas Grekas
0c1261ebe1 Merge branch '5.2' into 5.x
* 5.2: (23 commits)
  [Console] Fix Windows code page support
  [SecurityBundle] Allow ips parameter in access_control accept comma-separated string
  [Form] Add TranslatableMessage support to choice_label option of ChoiceType
  Remove code that deals with legacy behavior of PHP_Incomplete_Class
  [Config][DependencyInjection] Uniformize trailing slash handling
  [PropertyInfo] Make ReflectionExtractor correctly extract nullability
  [PropertyInfo] fix attribute namespace with recursive traits
  [PhpUnitBridge] Fix tests with `@doesNotPerformAssertions` annotations
  Check redis extension version
  [Security] Update Russian translations
  [Notifier] Fix return SentMessage then Messenger not used
  [VarExporter] Add support of PHP enumerations
  [Security] Added missing Japanese translations
  [Security] Added missing Polish translations
  [Security] Add missing Italian translations #41051
  [Security] Missing translations pt_BR
  getProtocolVersion may return null
  Fix return type on isAllowedProperty method
  Make FailoverTransport always pick the first transport
  [TwigBridge] Fix HTML for translatable custom-file label in Bootstrap 4 theme
  ...
2021-05-07 16:34:05 +02:00
Nicolas Grekas
53e47b3e9d bug #41113 [Console] Fix Windows code page support (orkan)
This PR was submitted for the 5.x branch but it was squashed and merged into the 5.2 branch instead.

Discussion
----------

[Console] Fix Windows code page support

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #37385, Fix #35842, Fix #36324, Fix #37495, Fix #37278
| License       | MIT

Corrects previous fixes that dealt with the mojibake problem on Windows where an OEM code page was applied to an input string and then messed with PHP.internal_encoding setting used by the script. This caused strings with different encodings to be displayed on the console output.

Commits
-------

be68682fd1 [Console] Fix Windows code page support
2021-05-07 16:24:57 +02:00