Commit Graph

46690 Commits

Author SHA1 Message Date
Nicolas Grekas
70dec3c8a3 bug #34859 [SecurityBundle] Fix TokenStorage::reset not called in stateless firewall (jderusse)
This PR was merged into the 4.4 branch.

Discussion
----------

[SecurityBundle] Fix TokenStorage::reset not called in stateless firewall

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

By default, the service `security.token_storage` is resetable. https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/SecurityBundle/Resources/config/security.xml#L22-L24

But when using a stateless application without session, the `RegisterTokenUsageTrackingPass` replace the service `security.token_storage` by an alias to `security.untracked_token_storage` (which is not tagged as resetable.

Commits
-------

616c30f185 Fix TokenStorage::reset not called in stateless firewall
2019-12-06 18:42:06 +01:00
Jérémy Derussé
616c30f185
Fix TokenStorage::reset not called in stateless firewall 2019-12-06 15:46:06 +01:00
Christian Flothmann
33146778b5 Merge branch '4.3' into 4.4
* 4.3:
  [DotEnv] Remove `usePutEnv` property default value
  Set up typo fix
  [Validator] Allow underscore character "_" in URL username and password
  [SecurityBundle] Passwords are not encoded when algorithm set to \"true\"
  do not validate passwords when the hash is null
  [DI] fix resolving bindings for named TypedReference
  [DI] Fix making the container path-independent when the app is in /app
  Allow copy instead of symlink for ./link script
  [FrameworkBundle] resolve service locators in `debug:*` commands
  bumped Symfony version to 4.3.10
  updated VERSION for 4.3.9
  updated CHANGELOG for 4.3.9
  bumped Symfony version to 3.4.37
  updated VERSION for 3.4.36
  update CONTRIBUTORS for 3.4.36
  updated CHANGELOG for 3.4.36
  Add test on ServerLogHandler
2019-12-06 14:32:19 +01:00
Christian Flothmann
2ac56093a5 Merge branch '3.4' into 4.3
* 3.4:
  [Validator] Allow underscore character "_" in URL username and password
  [SecurityBundle] Passwords are not encoded when algorithm set to \"true\"
  do not validate passwords when the hash is null
  [DI] Fix making the container path-independent when the app is in /app
  Allow copy instead of symlink for ./link script
  [FrameworkBundle] resolve service locators in `debug:*` commands
  bumped Symfony version to 3.4.37
  updated VERSION for 3.4.36
  update CONTRIBUTORS for 3.4.36
  updated CHANGELOG for 3.4.36
2019-12-06 14:11:20 +01:00
Fabien Potencier
56fac414ff minor #34850 [DotEnv] Remove usePutEnv property default value (tucksaun)
This PR was merged into the 4.3 branch.

Discussion
----------

[DotEnv] Remove `usePutEnv` property default value

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

The default value is already set in the constructor (and changes in 5.0, see https://github.com/symfony/symfony/pull/31957/files#diff-3dc82e6e990428b0c71cf2112d02269fR44) and the class is final.

Commits
-------

362c339fa6 [DotEnv] Remove `usePutEnv` property default value
2019-12-06 13:12:56 +01:00
Tugdual Saunier
362c339fa6
[DotEnv] Remove usePutEnv property default value
The value is already set in the constructor (and changes in 5.0) and the class is final.
2019-12-06 12:04:06 +01:00
Nicolas Grekas
3c7b775b3e [Process] change the syntax of portable prepared command lines 2019-12-06 11:06:46 +01:00
Nicolas Grekas
0ad5dd5f73 bug #34827 [HttpFoundation] get currently session.gc_maxlifetime if ttl doesnt exists (rafaeltovar)
This PR was submitted for the master branch but it was squashed and merged into the 4.4 branch instead.

Discussion
----------

[HttpFoundation] get currently session.gc_maxlifetime if ttl doesnt exists

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

If option `ttl` was not defined in RedisSessionHandler, this got the default `session.gc_maxlifetime`. With this fixed, RedisSessionHandler get the currently `session.gc_maxlifetime`.

Commits
-------

b6253e2336 [HttpFoundation] get currently session.gc_maxlifetime if ttl doesnt exists
2019-12-06 10:28:45 +01:00
Rafael Tovar
b6253e2336 [HttpFoundation] get currently session.gc_maxlifetime if ttl doesnt exists 2019-12-06 10:28:38 +01:00
Nicolas Grekas
a672132392 minor #34829 [Messenger] "set up" typo fix (alex-bacart)
This PR was submitted for the 4.4 branch but it was merged into the 4.3 branch instead.

Discussion
----------

[Messenger] "set up" typo fix

| Q             | A
| ------------- | ---
| Branch?       | master for features / 3.4, 4.3, 4.4 or 5.0 for bug fixes <!-- 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 -->
| License       | MIT

![image](https://user-images.githubusercontent.com/13940752/70231803-1b4a9180-176c-11ea-9faf-b7addf81190a.png)
There's a typo, `setup` is a noun, but it should be a verb `set up`.

Commits
-------

b0daf020de Set up typo fix
2019-12-06 10:25:45 +01:00
Alex Bacart
b0daf020de Set up typo fix 2019-12-06 10:25:38 +01:00
Robin Chalas
5807f5f1fb bug #34755 [FrameworkBundle] resolve service locators in debug:* commands (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] resolve service locators in `debug:*` commands

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

Because of the way ServiceClosureArgument are dumped, we need to resolve locators after loading the xml dump of the container:
https://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php#L273

Commits
-------

820da66346 [FrameworkBundle] resolve service locators in `debug:*` commands
2019-12-06 04:55:08 +01:00
Thomas Calvet
c3574858b5 [DependencyInjection] Handle env var placeholders in CheckTypeDeclarationsPass 2019-12-05 23:06:19 +01:00
Nicolas Grekas
4194c4c56d [Cache] fix memory leak when using PhpArrayAdapter 2019-12-05 19:35:35 +01:00
Fabien Potencier
ffcb691698 bug #34832 [3.4][Validator] Allow underscore character "_" in URL username and password (romainneutron)
This PR was merged into the 3.4 branch.

Discussion
----------

[3.4][Validator] Allow underscore character "_" in URL username and password

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

Hello!

It's been a long time since my last push on Symfony :)
Here's a bug fix. I think URL usernames and password may contain an underscore. Let me know!

Commits
-------

869518bc7e [Validator] Allow underscore character "_" in URL username and password
2019-12-05 17:05:19 +01:00
Romain Neutron
869518bc7e
[Validator] Allow underscore character "_" in URL username and password 2019-12-05 15:05:00 +01:00
Fabien Potencier
6b7029b011 bug #34765 [DoctrineBridge] Removed QueryBuilder type hint in getLoader() (HeahDude)
This PR was merged into the 5.0 branch.

Discussion
----------

[DoctrineBridge] Removed QueryBuilder type hint in getLoader()

| Q             | A
| ------------- | ---
| Branch?       | 5.0 <!-- 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       | ~
| License       | MIT
| Doc PR        | ~
<!--
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 master.
-->
Follows #34600.

Commits
-------

8621852396 [DoctrineBridge] Removed QueryBuilder type hint in getLoader()
2019-12-05 07:12:07 +01:00
Fabien Potencier
bfe697bb86 bug #34811 [TwigBridge] Update bootstrap_4_layout.html.twig missing switch-custom label (sabruss)
This PR was submitted for the master branch but it was merged into the 4.4 branch instead (closes #34811).

Discussion
----------

[TwigBridge] Update bootstrap_4_layout.html.twig missing switch-custom label

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

Missing .custom-control-label for bootstrap custom-switch when using .switch-custom class in label_attr

Commits
-------

9347b2ea2f [TwigBridge] Update bootstrap_4_layout.html.twig
2019-12-05 06:58:48 +01:00
sabruss
9347b2ea2f [TwigBridge] Update bootstrap_4_layout.html.twig
Missing custom-control-label for custom-switch
2019-12-05 06:58:42 +01:00
Fabien Potencier
c3b5ec5139 bug #34820 [FrameworkBundle][SodiumVault] Create secrets directory only when it is used (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle][SodiumVault] Create secrets directory only when it is used

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

FWB `secrets` is enabled by default. After upgrading an app to 4.4, a directory is created (and checked on every request) even if I don't use this feature. Can't we just disable it by default btw?

Commits
-------

c86157040a [FrameworkBundle][SodiumVault] Create secrets directory only when needed
2019-12-05 06:57:28 +01:00
Jules Pietri
8621852396 [DoctrineBridge] Removed QueryBuilder type hint in getLoader() 2019-12-04 21:05:45 +01:00
Thomas Calvet
c86157040a [FrameworkBundle][SodiumVault] Create secrets directory only when needed 2019-12-04 18:30:15 +01:00
Christian Flothmann
7ab53f9a39 fix parsing negative octal numbers 2019-12-04 12:33:46 +01:00
Nicolas Grekas
416e40d943 [String] implement __sleep()/__wakeup() on strings 2019-12-04 09:11:16 +01:00
Fabien Potencier
302243dd39 bug #34776 [DI] fix resolving bindings for named TypedReference (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[DI] fix resolving bindings for named TypedReference

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

As spotted in https://github.com/symfony/symfony/pull/34769#issuecomment-561064156

Commits
-------

62c227e368 [DI] fix resolving bindings for named TypedReference
2019-12-04 07:44:27 +01:00
Fabien Potencier
7f567584a5 bug #34794 [DependencyInjection] Resolve expressions in CheckTypeDeclarationsPass (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] Resolve expressions in CheckTypeDeclarationsPass

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

One more case we forgot 😅

Commits
-------

b6c5a54cfd [DependencyInjection] Resolve expressions in CheckTypeDeclarationsPass
2019-12-04 07:43:26 +01:00
Fabien Potencier
98694d8677 bug #34795 [Routing][ObjectLoader] Remove forgotten deprecation after merge (fancyweb)
This PR was merged into the 5.0 branch.

Discussion
----------

[Routing][ObjectLoader] Remove forgotten deprecation after merge

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

https://github.com/symfony/symfony/pull/34621 needs to be gone on 5.0. We want to throw here. I think it was forgotten when merging in 5.0.

Commits
-------

4e60b9db22 [Routing][ObjectLoader] Remove forgotten deprecation after merge
2019-12-04 07:40:02 +01:00
Fabien Potencier
fb08d9c101 Merge branch '4.4' into 5.0
* 4.4:
  Fixed translations file dumper behavior
  When set, get secret from config variable
  [FrameworkBundle] Set the parameter bag as resolved in ContainerLintCommand
  [SecurityBundle] Fix switch_user provider configuration handling
2019-12-04 07:31:37 +01:00
Fabien Potencier
4af59c250f bug #34797 [Translation] Fix FileDumper behavior (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

[Translation] Fix FileDumper behavior

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

Execute `bin/console translation:update --force en` command:

## Before
See related issue for details #34713

## After
The default translation file name will depend on whether the intl (or polyfill) extension is installed or not.

For exmaple:

| Intl extension (or polyfill) installed | translation file created |
| --- | --- |
| no | messages.en.xlf |
| yes | messages+intl-icu.en.xlf |

However, if you are currently updating a single file, that file name will be used regardless of whether the Intl extension is installed, i.e. if you have this translation file: `messages.en.xlf`, new translation keys will be stored in it, even if you have installed the intl extension.

Last, if both translation files (`messages.es.xlf` and `messages+intl-icu.en.xlf`) coexist in the same path, rare but possible, we will use the default filename guessed earlier to store all current messages and the another file will be emptied.

Commits
-------

1c41ae7631 Fixed translations file dumper behavior
2019-12-04 07:23:12 +01:00
Yonel Ceruto
1c41ae7631 Fixed translations file dumper behavior 2019-12-03 23:35:13 -05:00
Thomas Calvet
4e60b9db22 [Routing][ObjectLoader] Remove forgotten deprecation after merge 2019-12-03 23:29:20 +01:00
Robin Chalas
59126e0f9c bug #34738 [SecurityBundle] Passwords are not encoded when algorithm set to "true" (nieuwenhuisen)
This PR was merged into the 3.4 branch.

Discussion
----------

[SecurityBundle] Passwords are not encoded when algorithm set to "true"

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

If the algorithm is set to `true`, password will be encode as plain password.

```
security:
    encoders:
        App\User\User:
            algorithm: true
```

The reason for this is the not strict comparison of php switches.

```
switch ($config['algorithm']) {
            case 'plaintext':
}
```

`true == 'plaintext'` is `true`, so the first case is hit. My first solution was to cast the algorithm to a string, to prevent this. After some feedback I have catch this problem earlier and does not allow true as valid value to the algorithm option.

Ps. This is my first PR for Symfony, any feedback is welcome :-)!

Commits
-------

83a5517c01 [SecurityBundle] Passwords are not encoded when algorithm set to \"true\"
2019-12-03 22:06:31 +01:00
Jeroen van den Nieuwenhuisen
83a5517c01 [SecurityBundle] Passwords are not encoded when algorithm set to \"true\" 2019-12-03 22:04:52 +01:00
Robin Chalas
e1f7b7886e bug #34759 [SecurityBundle] Fix switch_user provider configuration handling (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[SecurityBundle] Fix switch_user provider configuration handling

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

The default provider here can be null if there are multiple configured providers configured + the firewall doesn't define its provider at the root level + it is anonymous, ie:
```yaml
providers:
    my_provider:
        # ...
    monitor_provider:
        # ...
firewalls:
    main:
        switch_user:
            provider: my_provider
        anonymous: true
        # ...
```

Commits
-------

417169b745 [SecurityBundle] Fix switch_user provider configuration handling
2019-12-03 21:51:34 +01:00
Robin Chalas
cb429cd762 bug #34779 [Security] do not validate passwords when the hash is null (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security] do not validate passwords when the hash is null

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

Commits
-------

5699cb22bb do not validate passwords when the hash is null
2019-12-03 21:49:28 +01:00
Thomas Calvet
b6c5a54cfd [DependencyInjection] Resolve expressions in CheckTypeDeclarationsPass 2019-12-03 21:47:51 +01:00
Robin Chalas
120f32c3c4 bug #34786 [SecurityBundle] Use config variable in AnonymousFactory (martijnboers)
This PR was merged into the 4.4 branch.

Discussion
----------

[SecurityBundle] Use config variable in AnonymousFactory

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

It looks like the `AnonymousFactory` was copied incorrectly in https://github.com/symfony/symfony/pull/33503 as it uses the old `$firewall` variable available in `SecurityExtension.php`. Changing this to `$config` yields the desired results

Commits
-------

8d850d2da4 When set, get secret from config variable
2019-12-03 21:44:39 +01:00
Robin Chalas
c01a583b75 bug #34784 [FrameworkBundle] Set the parameter bag as resolved in ContainerLintCommand (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Set the parameter bag as resolved in ContainerLintCommand

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix https://github.com/symfony/symfony/issues/34526, Closes #34767
| License       | MIT
| Doc PR        | -

Alternative to https://github.com/symfony/symfony/pull/34767, idea by @nicolas-grekas.

Commits
-------

e8d3c2b969 [FrameworkBundle] Set the parameter bag as resolved in ContainerLintCommand
2019-12-03 21:41:27 +01:00
Thomas Calvet
de03cee846 [SecurityBundle] Properly escape regex in AddSessionDomainConstraintPass 2019-12-03 19:26:40 +01:00
Christian Flothmann
5699cb22bb do not validate passwords when the hash is null 2019-12-03 19:05:24 +01:00
Martijn Boers
8d850d2da4
When set, get secret from config variable
This was incorrectly copied in PR

https://github.com/symfony/symfony/pull/33503
2019-12-03 17:45:30 +01:00
Nicolas Grekas
9dbeab93f2 Merge branch '4.4' into 5.0
* 4.4:
  [Security/Core] Fix checking for SHA256/SHA512 passwords
  [Cache][Lock] fix tests
  bumped Symfony version to 4.4.2
  updated VERSION for 4.4.1
  updated CHANGELOG for 4.4.1
2019-12-03 17:35:18 +01:00
Nicolas Grekas
6611ae654b minor #34721 [MonologBridge] Add test on ServerLogHandler (jderusse)
This PR was merged into the 4.3 branch.

Discussion
----------

[MonologBridge] Add test on ServerLogHandler

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

After writing https://github.com/symfony/symfony/pull/34697#issuecomment-559840469 I realized that  ServerLogHandler wasn't tested.

Tell me if it's a BugFix and should be rebased on 4.3

Commits
-------

8c7947f827 Add test on ServerLogHandler
2019-12-03 17:28:04 +01:00
Nicolas Grekas
3b42ca9ae0 minor #34758 Allow copy instead of symlink for ./link script (ogizanagi)
This PR was merged into the 3.4 branch.

Discussion
----------

Allow copy instead of symlink for ./link script

| Q             | A
| ------------- | ---
| Branch?       | 3.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       | N/A <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | N/A

Not the most efficient way to work, but sometimes it helps to test a bug fix/feature within an existing project for which symlinks can't be resolved due to the dev environment (e.g: a Vagrant where only the current project directory is mounted).

Commits
-------

b28fe66363 Allow copy instead of symlink for ./link script
2019-12-03 17:16:07 +01:00
Nicolas Grekas
1f0070521c minor #34778 [Cache][Lock] fix tests (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache][Lock] fix tests

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

Commits
-------

5845c3f8cd [Cache][Lock] fix tests
2019-12-03 17:13:30 +01:00
Nicolas Grekas
976a938736 [String] inline Latin-ASCII rules 2019-12-03 16:53:46 +01:00
Nicolas Grekas
0a9a6ba8d6 bug #34763 [Security/Core] Fix checking for SHA256/SHA512 passwords (David Brooks)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security/Core] Fix checking for SHA256/SHA512 passwords

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->
<!--
The code to validate bcrypt passwords (#31763) needs to include SHA256 and SHA512-hashed passwords.  These are used on RedHat (and derived) systems.

Since SHA256/512 don't appear to have a limit of 72 characters, I simply created a new if() block.
-->

Commits
-------

799c85b67c [Security/Core] Fix checking for SHA256/SHA512 passwords
2019-12-03 15:57:45 +01:00
David Brooks
799c85b67c [Security/Core] Fix checking for SHA256/SHA512 passwords 2019-12-03 15:57:37 +01:00
Thomas Calvet
e8d3c2b969 [FrameworkBundle] Set the parameter bag as resolved in ContainerLintCommand 2019-12-03 14:44:43 +01:00
Nicolas Grekas
5845c3f8cd [Cache][Lock] fix tests 2019-12-03 11:28:45 +01:00