Commit Graph

49226 Commits

Author SHA1 Message Date
Fabien Potencier fd84b535a8 Update VERSION for 3.4.48 2021-05-12 15:01:01 +02:00
Fabien Potencier 684ab1f40c Update CHANGELOG for 3.4.48 2021-05-12 15:00:55 +02:00
Nicolas Grekas d5c0fbac85 Merge branch '3.4' into 4.4
* 3.4:
  [Security][Guard] Prevent user enumeration via response content
2021-05-12 14:42:28 +02:00
Nicolas Grekas 2a581d22cc security #cve-2021-21424 [Security][Guard] Prevent user enumeration (chalasr)
This PR was merged into the 3.4 branch.
2021-05-12 14:32:10 +02:00
Nyholm a0f8fc5c08
minor #41180 [Security] Add missing Finnish translations (mikkoaf)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security] Add missing Finnish translations

| 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 #41043
| License       | MIT
| Doc PR        |

Added some missing Finnish translations.

Commits
-------

c1cefc088d [Security] Add missing Finnish translations
2021-05-12 08:47:11 +02:00
Nyholm d36f5e31ee
[CI][Psalm] Install stable/released PHPUnit 2021-05-12 08:32:34 +02:00
Mikko Ala-Fossi c1cefc088d [Security] Add missing Finnish translations 2021-05-12 07:44:21 +03:00
Nicolas Grekas 9a53e6acc1 bug #41176 [DependencyInjection] fix dumping service-closure-arguments (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] fix dumping service-closure-arguments

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

5.3 uses service closures a bit more, so that this is required to make the `lint:container` command work.

Commits
-------

1aa9a249fc [DependencyInjection] fix dumping service-closure-arguments
2021-05-11 17:59:00 +02:00
Nicolas Grekas 1aa9a249fc [DependencyInjection] fix dumping service-closure-arguments 2021-05-11 17:55:42 +02:00
Fabien Potencier 89c1be89f0 bug #41168 WDT: Only load "Sfjs" if it is not present already (weaverryan)
This PR was merged into the 4.4 branch.

Discussion
----------

WDT: Only load "Sfjs" if it is not present already

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

Hi!

Playing with Turbo, I noticed two small issues with the WDT:

1) When you click a link (which Turbo loads via AJAX), the new toolbar would correctly load, but its "AJAX tab" would be missing/empty. At first, that seems.. at least... "correct enough". After all, we *did* just load a new web debug toolbar. However, this can be avoided by simply *not* redefining the `Sfjs` variable: if it already exists, just use it. And this is the intention of that object, I believe: for it to be loaded *once*, and then reused over and over again via its `loadToolbar()` method.

2) Additionally, I was experimenting with some crazy prefetch + Turbo functionality. It works, but caused one minor issue with the web debug toolbar. The flow is this:

A) A prefetch request is made to pre-cache a URL in Turbo.
B) When that links is actually clicked, the cached version from (A) is used as the "Preview". It's HTML calls `Sfjs.loadToolbar()`.
C) At the same moment as (B), another AJAX request is made to the same URL from (A) to get the full, fresh page (in case it's out of date).
D) When (C) finishes, it will have its own `Sfjs.loadToolbar()` call.

The problem is that the AJAX request for the first web debug toolbar (from B) sometimes finishes *after* the AJAX call made by Turbo for (C). The result is that the first web debug toolbar tries to activate itself... but it's already gone from the page.

I realize this is a... kind of crazy scenario, but I think the fix is legit: if, for any reason, the web debug toolbar element is not on the page, we should not try to initialize it. It results in:

<img width="431" alt="Screen Shot 2021-05-10 at 3 49 06 PM" src="https://user-images.githubusercontent.com/121003/117716165-429a5f00-b1a7-11eb-9b99-bf08591d2ff4.png">

## To Test

JUST to be on the safe side, I prepared a symfony-demo app with Turbo installed, and using these changes. You can try it here - https://github.com/weaverryan/symfony-demo/tree/turbo - the README is updated to quickly get it running (no need to even run yarn, the JavaScript files are committed).

Thanks!

Commits
-------

47ef65f336 only load Sfjs if it is not present
2021-05-11 08:55:30 +02:00
Ryan Weaver 47ef65f336 only load Sfjs if it is not present
Plus, avoid loading the toolbar if it is no longer on the page
2021-05-10 15:50:57 -04: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
Jeremiasz Major 545f058367
[Console] Fixes for PHP 8.1 deprecations 2021-05-10 14:53:15 +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
Rokas Mikalkėnas f2dedd8a53 Missing security lt translations added 2021-05-08 12:04:37 +03:00
Nicolas Grekas 0e738ef170 bug #40917 [Config][DependencyInjection] Uniformize trailing slash handling (dunglas)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Config][DependencyInjection] Uniformize trailing slash handling

| 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

Currently, the handling of trailing slashes in file loaders exclusion rules is inconsistent, which can create hard to debug issues.

Example:

```yaml
services:
    App\:
        resource: '../src/'
        exclude:
            # This works
            - '../src/FooBar/DependencyInjection/'
            - '../src/FooBar/DependencyInjection'
            - '../src/FooBar/DependencyInjection/*'
            - '../src/*/DependencyInjection'
            - '../src/*/DependencyInjection/*'

            # This doesn't work
            - '../src/*/DependencyInjection/'
```

This PR fixes this subtle issue.

Commits
-------

dc50aa3b55 [Config][DependencyInjection] Uniformize trailing slash handling
2021-05-07 15:37:58 +02:00
Kévin Dunglas dc50aa3b55 [Config][DependencyInjection] Uniformize trailing slash handling 2021-05-07 15:37:51 +02:00
Nicolas Grekas fab61ee9df bug #40699 [PropertyInfo] Make ReflectionExtractor correctly extract nullability (shiftby)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[PropertyInfo] Make ReflectionExtractor correctly extract nullability

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

When the property had a default value ReflectionExtractor was always returning isNullable: false. After PHP 7.4 we can get isNullable from the typehint.

Commits
-------

d5fce4c779 [PropertyInfo] Make ReflectionExtractor correctly extract nullability
2021-05-07 15:22:49 +02:00
Maxim Dovydenok d5fce4c779 [PropertyInfo] Make ReflectionExtractor correctly extract nullability 2021-05-07 15:22:44 +02:00
Nicolas Grekas ba3834647f bug #40874 [PropertyInfo] fix attribute namespace with recursive traits (soullivaneuh)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[PropertyInfo] fix attribute namespace with recursive traits

| 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 #36997 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

The targeted issue is closed because considered as solved by https://github.com/symfony/symfony/pull/40175.

However, the fix is not enough and is not working with recursive trait inclusion. (see https://github.com/symfony/symfony/issues/36997#issuecomment-822572640).

This pull request is completing the first fix of `@xabbuh`, trying to follow the same coding style. 😉

Commits
-------

bbadfb34cc [PropertyInfo] fix attribute namespace with recursive traits
2021-05-07 15:17:33 +02:00
Sullivan SENECHAL bbadfb34cc [PropertyInfo] fix attribute namespace with recursive traits 2021-05-07 15:17:28 +02:00
Nicolas Grekas ae38bda5c2 bug #41099 [Cache] Check if phpredis version is compatible with stream parameter (nicolassing)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache] Check if phpredis version is compatible with stream parameter

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

If you use phpredis <5.3.0, you can't connect to Redis since symfony/cache 5.2.7

Fixes #41110

Commits
-------

841d85a7ce Check redis extension version
2021-05-07 14:34:03 +02:00
Nicolas Assing 841d85a7ce Check redis extension version 2021-05-07 14:33:52 +02:00
Nicolas Grekas c276f0dfd6 minor #40931 [Translation] [CI] Set default locale for IdentityTranslatorTest (Nyholm)
This PR was merged into the 4.4 branch.

Discussion
----------

[Translation] [CI] Set default locale for IdentityTranslatorTest

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

This will fix a few CI issues. Not sure if this is the correct fix.

Commits
-------

92a61b1cf6 [Translation] Set default locale for IdentityTranslatorTest
2021-05-07 14:15:21 +02:00
Nicolas Grekas e0fe8c1bca minor #41108 [Security] Update Russian translations (a1812)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Security] Update Russian translations

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

Translate to Russian

Commits
-------

965c6e4a2d [Security] Update Russian translations
2021-05-07 14:07:35 +02:00
Roman Martinuk 965c6e4a2d [Security] Update Russian translations 2021-05-07 14:07:27 +02:00
Nicolas Grekas e51e651c4a bug #41072 [VarExporter] Add support of PHP enumerations (alexandre-daubois)
This PR was merged into the 4.4 branch.

Discussion
----------

[VarExporter] Add support of PHP enumerations

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

Commits
-------

4b0f2997a5 [VarExporter] Add support of PHP enumerations
2021-05-06 21:18:04 +02:00
Alexandre Daubois 4b0f2997a5 [VarExporter] Add support of PHP enumerations 2021-05-06 21:16:33 +02:00
Fabien Potencier 72b6001f83 minor #41122 [Security] Added missing Japanese translations (kshida)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Security] Added missing Japanese translations

| Q             | A
| ------------- | ---
| Branch?       | 4.4<!-- see below -->
| 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 #41052 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | N/A <!-- required for new features -->
<!--
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/releases):
 - 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 5.x.
 - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
-->
Added id19 and id20.
The indentation for id17 and id18 was incorrect, so I fixed it.
I hope it helps you :)

Commits
-------

26cd193085 [Security] Added missing Japanese translations
2021-05-06 18:44:07 +02:00
kshida 26cd193085 [Security] Added missing Japanese translations 2021-05-06 18:44:00 +02:00
Fabien Potencier beca689412 minor #41117 [Security] Add missing Italian translations (ramundomario)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security] Add missing Italian translations

| Q             | A
| ------------- | ---
| Branch?       | 4.4 <!-- see below -->
| 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 #41051 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | N/A <!-- required for new features -->

Commits
-------

4dc5c82fa4 [Security] Add missing Italian translations #41051
2021-05-06 13:04:48 +02:00
Fabien Potencier 4c7a54ac08 minor #41079 [Security] Added missing Polish translations (ShiroRyokoshi)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Security] Added missing Polish translations

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

The translations added were based off the english ones.
This is my first PR ever, I hope I didn't do any mistakes.

Commits
-------

774a1d35da [Security] Added missing Polish translations
2021-05-06 13:02:55 +02:00
Shiro 774a1d35da [Security] Added missing Polish translations 2021-05-06 13:02:50 +02:00
Mario Ramundo 4dc5c82fa4 [Security] Add missing Italian translations #41051 2021-05-05 22:22:20 +02:00
Alexander M. Turek 093b15c476 minor #41109 [HttpFoundation] Request::getProtocolVersion may return null (Jean85)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation] Request::getProtocolVersion may return null

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

This is just a minor PHPDoc fix, but we stumbled on it in https://github.com/getsentry/sentry-symfony/pull/495, and static analysis complains about our fix.

Basically, `SERVER_PROTOCOL` may not be set, even if it shouldn't be missing according to [RFC 3875 (GCI spec)](https://tools.ietf.org/html/rfc3875#section-4.1.16). In our case, the user reported the issue because the request was issued interally by a pod health check inside Kubernetes.

Commits
-------

99aadb31ff getProtocolVersion may return null
2021-05-05 18:50:48 +02:00
Nyholm f9deae095b
minor #41092 [Security] Missing translations pt_BR (rezehnde)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Security] Missing translations pt_BR

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

Commits
-------

8c61c2273f [Security] Missing translations pt_BR
2021-05-05 10:05:55 +02:00
Marcos Rezende 8c61c2273f
[Security] Missing translations pt_BR 2021-05-05 10:05:48 +02:00
Alessandro Lai 99aadb31ff
getProtocolVersion may return null 2021-05-05 09:40:41 +02:00
Alexander M. Turek 21e9894c10 minor #41090 [Security] Added translations for pt security file. (Ana Raro)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security] Added translations for pt security file.

| Q             | A
| ------------- | ---
| Branch?       | 4.4<!-- see below -->
| 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 #41062 <!-- 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 -->
<!--
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/releases):
 - 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 5.x.
 - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
-->

Commits
-------

22aad3962c Added translations for pt security file.
2021-05-04 19:43:10 +02:00
Alexander M. Turek c1e9ba8708 minor #41091 ref #41087: missing security turksih translations (Koray Zorluoglu)
This PR was merged into the 4.4 branch.

Discussion
----------

ref #41087: missing security turksih translations

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

Missing Türkish Translations from Security Component.

Commits
-------

af53ecd1fd ref #41087: missing turkish translations from security component
2021-05-04 19:42:08 +02:00
Alexander M. Turek 68ee96d371 bug #41105 [Inflector][String] Fixed singularize `edges` > `edge` (ruudk)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Inflector][String] Fixed singularize `edges` > `edge`

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

I noticed that calling `$inflector->singularize('edges');` returned `['edg', 'edges']`.

It should be `edge`, only. See https://en.wiktionary.org/wiki/edge

Commits
-------

ebfb0c9944 [Inflector][String] Fixed singularize `edges` > `edge`
2021-05-04 19:40:55 +02:00
Ruud Kamphuis ebfb0c9944 [Inflector][String] Fixed singularize `edges` > `edge` 2021-05-04 19:40:47 +02:00
Alexander M. Turek 4d3768f324 minor #41100 [Security] Add missing Spanish translations (makraz)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security] Add missing Spanish translations

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

Commits
-------

4e6e276d77 [Security] Add missing Spanish translations
2021-05-04 18:02:01 +02:00
Hamza Makraz 4e6e276d77 [Security] Add missing Spanish translations 2021-05-04 15:57:45 +00:00
Robin Chalas 98d3201add minor #41093 [Security] Update Czech translations (mhujer)
This PR was submitted for the 5.x branch but it was merged into the 4.4 branch instead.

Discussion
----------

[Security] Update Czech translations

| Q             | A
| ------------- | ---
| Branch?       | 5.x for features
| 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 #41040
| License       | MIT

Closes #41040

The translations are not perfect for some %minutes% values as the pluralization is more complicated in Czech than in English. (See: https://github.com/symfony/symfony/issues/40863#issuecomment-823928594)

Commits
-------

076310cfe3 [Security] Update Czech translations
2021-05-04 17:37:31 +02:00