Commit Graph

37719 Commits

Author SHA1 Message Date
Nicolas Grekas
29cabf94c5 minor #33987 [CI] fix building local packages (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[CI] fix building local packages

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

Commits
-------

b7b6942251 [CI] fix building local packages
2019-10-15 14:25:35 +02:00
Nicolas Grekas
b7b6942251 [CI] fix building local packages 2019-10-15 14:09:56 +02:00
Nicolas Grekas
fb2a7a3d35 minor #33974 [Cache] fix PHP 5.6 compatibility (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] fix PHP 5.6 compatibility

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

Commits
-------

5c82d301a7 fix PHP 5.6 compatibility
2019-10-13 21:35:09 +02:00
Christian Flothmann
5c82d301a7 fix PHP 5.6 compatibility 2019-10-13 20:43:12 +02:00
Fabien Potencier
0065f7579b bug #33948 [PropertyInfo] Respect property name case when guessing from public method name (antograssiot)
This PR was merged into the 3.4 branch.

Discussion
----------

[PropertyInfo] Respect property name case when guessing from public method name

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

Using camelCase, with an attribute `$aFooBar`, naming the getter/setter `getAFooBar()`/`setAFooBar()`,  returns the property name as AFooBar instead of aFooBar.

# Before
Property name `'AFooBar'`

# After
Property name `'aFooBar'` as expected

Commits
-------

843bb76f8a [PropertyInfo] Respect property name case when guessing from public method name
2019-10-13 10:38:57 +02:00
Nicolas Grekas
1201085f72 bug #33962 [Cache] fixed TagAwareAdapter returning invalid cache (v-m-i)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] fixed TagAwareAdapter returning invalid cache

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

This PR fixes `TagAwareAdapter` returning `CacheItem` when item-tags pair is missing tag key in pool. Currently `TagAwareAdapter` returns `CacheItem` with empty tags and `isHit` set to `true`. With this PR it returns `CacheItem` with `isHit` set to `false` as we can't know if item is valid or invalid when it's missing tag entry so we treat it as cache miss.

Commits
-------

946f0a1e11 [Cache] fixed TagAwareAdapter returning invalid cache
2019-10-12 11:36:31 +02:00
Vedran Mihočinec
946f0a1e11 [Cache] fixed TagAwareAdapter returning invalid cache 2019-10-12 11:36:03 +02:00
Nicolas Grekas
a8a4aadf24 bug #33965 [HttpFoundation] Add plus character + to legal mime subtype (ilzrv)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpFoundation] Add plus character `+` to legal mime subtype

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

For example, the following mime type (used for epub) is not recognized given the current regexp: `application/epub+zip; charset=binary`

Commits
-------

56895f12b9 Add plus character `+` to legal mime subtype
2019-10-12 10:56:52 +02:00
Ilia Lazarev
56895f12b9 Add plus character + to legal mime subtype
For example, the following mime type (used for epub) is not recognized given the current regexp: `application/epub+zip`
2019-10-12 10:55:17 +02:00
Nicolas Grekas
fefb2ff020 bug #32943 [Dotenv] search variable values in ENV first then env file (soufianZantar)
This PR was merged into the 3.4 branch.

Discussion
----------

[Dotenv] search variable values in ENV first then env file

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #32595
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- 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/roadmap):
 - 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 4.4.
 - Legacy code removals go to the master branch.
-->

I think we must searhing the value of variables in $_ENV before the .env file to fix this issues.
before this fix Parse method will return the value in .env file and not the value passed in this command `composer dump-env prod `.

**the issue:**

In my .env file, I have a variable TEST that depends on the APP_ENV variable like this:

```
# .env file

###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=2eb810c79fba0dd5c029a2fa53bfdb51
###< symfony/framework-bundle ###

TEST=foo_${APP_ENV}

```
I run composer dump-env dev command to generate my .env.locale.php, everything works fine, the value of my variable TEST is correct.

```
// .env.locale.php

return array (
  'APP_ENV' => 'dev',
  'TEST' => 'foo_dev',
  'APP_SECRET' => '2eb810c79fba0dd5c029a2fa53bfdb51',
);
```
Then I run the same command with prod environment (composer dump-env prod), the value of TEST is wrong (it is same as for dev)

```
// .env.locale.php

return array (
  'APP_ENV' => 'prod',
  'TEST' => 'foo_dev',
  'APP_SECRET' => '2eb810c79fba0dd5c029a2fa53bfdb51',
);
```

Commits
-------

3018041782 [Dotenv] search variable values in ENV first then env file
2019-10-11 15:39:49 +02:00
soufianZantar
3018041782 [Dotenv] search variable values in ENV first then env file 2019-10-11 15:36:17 +02:00
Nicolas Grekas
49ad46e283 bug #33943 [VarDumper] fix resetting the "bold" state in CliDumper (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[VarDumper] fix resetting the "bold" state in CliDumper

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

Commits
-------

21645a5b96 [VarDumper] fix resetting the "bold" state in CliDumper
2019-10-11 15:34:05 +02:00
Anto
843bb76f8a
[PropertyInfo] Respect property name case when guessing from public method name 2019-10-11 06:14:16 +02:00
Fabien Potencier
417222515b minor #33938 SCA: added missing break in a loop (kalessil)
This PR was merged into the 3.4 branch.

Discussion
----------

SCA: added missing break in a loop

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

Commits
-------

6af04bbac6 SCA: added missing break in a loop
2019-10-10 21:22:59 +02:00
Nicolas Grekas
21645a5b96 [VarDumper] fix resetting the "bold" state in CliDumper 2019-10-10 13:03:19 +02:00
Vladimir Reznichenko
6af04bbac6 SCA: added missing break in a loop 2019-10-09 21:00:06 +02:00
Nicolas Grekas
31fcf93253 [Validator] sync NO and NB translations 2019-10-09 16:33:48 +02:00
Fabien Potencier
c281b3b248 minor #33907 [Validator] Adds missing translations for the Norwegian Bokmål ("nb") locale (Harald Tollefsen)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Adds missing translations for the Norwegian Bokmål ("nb") locale

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

Commits
-------

5baa3ea8d4 Adds missing translations for no nb
2019-10-08 11:22:35 +02:00
Harald Tollefsen
5baa3ea8d4 Adds missing translations for no nb 2019-10-08 11:13:14 +02:00
Fabien Potencier
986975469e minor #33893 [Validator] Add the missing translations for the Swedish ("sv") locale (terdia)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Add the missing translations for the Swedish ("sv") locale

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

This PR adds missing Swedish ("sv") locale translations
 to [src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf](src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf) file.

Ref: https://github.com/symfony/symfony/issues/33629

Commits
-------

0db883888c Add the missing translations for the Swedish ("sv") locale
2019-10-08 07:50:00 +02:00
Ogbemudia Terry Osayawe
0db883888c Add the missing translations for the Swedish ("sv") locale 2019-10-07 21:31:56 +02:00
Fabien Potencier
e3624e7086 bumped Symfony version to 3.4.33 2019-10-07 16:51:28 +02:00
Fabien Potencier
2815d1fa34
Merge pull request #33889 from fabpot/release-3.4.32
released v3.4.32
2019-10-07 16:42:16 +02:00
Fabien Potencier
83b90c2e00 updated VERSION for 3.4.32 2019-10-07 16:41:56 +02:00
Fabien Potencier
fd683f05ea update CONTRIBUTORS for 3.4.32 2019-10-07 16:41:46 +02:00
Fabien Potencier
ed01f3c511 updated CHANGELOG for 3.4.32 2019-10-07 16:41:35 +02:00
Nicolas Grekas
0272b8d341 [travis] Fix build-packages script 2019-10-07 14:36:18 +02:00
Christian Flothmann
7432601b8e bug #33834 [Validator] Fix ValidValidator group cascading usage (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Fix ValidValidator group cascading usage

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

`$this->context->getGroup()` returns `string` or `null`.

`ContextualValidatorInterface::validate()` 3rd argument accepts an array but it must not contain `null` (its contract doesn't allow it). If it does, it will fail in `RecursiveContextualValidator::validateInGroup()` for example because of the `string` scalar type on the `$group` argument. (on 4.4)

Note that in our "common" usage of the `Valid` constraint, the group in its validator will never be `null` because this constraint has a special treatment. However, if this validator is reused in a custom way, it can fail.

Commits
-------

72684b001c [Validator] Fix ValidValidator group cascading usage
2019-10-07 11:27:57 +02:00
Nicolas Grekas
718fb38db0 minor #33877 Remove useless testCanCheckIfTerminalIsInteractive test case (ostrolucky)
This PR was merged into the 3.4 branch.

Discussion
----------

Remove useless testCanCheckIfTerminalIsInteractive test case

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

This test case does not work for following reasons:
1. `$inputStream` is `NULL`. `posix_isatty` happily swallows null and returns `true`. Test would have to use [CommandTester::setInputs](ac4e9b0b26/src/Symfony/Component/Console/Tester/CommandTester.php (L66)) or call `$tester->getInput()->setStream()` to fix this
1. Even if 1. is fixed, there are no internal `posix_isatty` calls going on. [ApplicationTester calls setInteractive only when such option is passed](b0a3208588/src/Symfony/Component/Console/Tester/ApplicationTester.php (L66)), otherwise it will never be marked as interactive

Commits
-------

a84e4e021a Remove useless testCanCheckIfTerminalIsInteractive test case
2019-10-07 10:40:10 +02:00
Gabriel Ostrolucký
a84e4e021a
Remove useless testCanCheckIfTerminalIsInteractive test case 2019-10-06 21:52:09 +02:00
Fabien Potencier
14ccaf503e minor #33844 [Validator] Add the missing translations for the Thai ("th") locale (Atthaphon Urairat)
This PR was squashed before being merged into the 3.4 branch (closes #33844).

Discussion
----------

[Validator] Add the missing translations for the Thai ("th") locale

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

I have added the missing translations for the Thai.
Also fixed a typo on trans-unit id=54.

Commits
-------

2315be85d8 [Validator] Add the missing translations for the Thai (\"th\") locale
2019-10-05 09:00:03 +02:00
Atthaphon Urairat
2315be85d8 [Validator] Add the missing translations for the Thai (\"th\") locale 2019-10-05 08:59:57 +02:00
Nicolas Grekas
14d0e27bf0 minor #33852 [Intl] Update the ICU data to 65.1 (jakzal)
This PR was merged into the 3.4 branch.

Discussion
----------

[Intl] Update the ICU data to 65.1

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

Commits
-------

5cc9811fa9 [Intl] Update the ICU data to 65.1
2019-10-04 21:42:13 +02:00
Jakub Zalas
5cc9811fa9
[Intl] Update the ICU data to 65.1 2019-10-04 20:48:33 +02:00
Nicolas Grekas
5c4f2a972a bug #33841 [VarDumper] fix dumping uninitialized SplFileInfo (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[VarDumper] fix dumping uninitialized SplFileInfo

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix https://github.com/bobthecow/psysh/issues/570
| License       | MIT
| Doc PR        | -

Commits
-------

b0f42333a5 [VarDumper] fix dumping uninitialized SplFileInfo
2019-10-04 20:45:27 +02:00
Fabien Potencier
c91e7ca084 minor #33840 Added missing translations (tarlepp)
This PR was merged into the 3.4 branch.

Discussion
----------

Added missing translations

| 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       | Fix #30163 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
<!--
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 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

865b9ffb09 Added missing translations.
2019-10-04 10:17:57 +02:00
Nicolas Grekas
b0f42333a5 [VarDumper] fix dumping uninitialized SplFileInfo 2019-10-04 09:44:32 +02:00
Tarmo Leppänen
865b9ffb09 Added missing translations. 2019-10-04 10:06:17 +03:00
Thomas Calvet
72684b001c [Validator] Fix ValidValidator group cascading usage 2019-10-03 17:45:25 +02:00
Robin Chalas
8622c8c95e bug #33799 [Security]: Don't let falsy usernames slip through impersonation (j4nr6n)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security]: Don't let falsy usernames slip through impersonation

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

When you try to impersonate users with a falsy username, `SwitchUserListener::handle()` would `return;` and impersonation would fail.

I'm using a third party OAuth provider that allows users to change their usernames with no guaranteed protection against re-use. To overcome that issue, I implemented `UserLoaderInterface::loadUserByUsername()` and query by a `providerId`.

After loading development fixtures, One user has `0` as it's `providerId`.

Commits
-------

64aecab0a7 Don't let falsey usernames slip through
2019-10-03 14:19:04 +02:00
Nicolas Grekas
9adef0795f minor #33821 Fixed invalid VarDumper upgrade-4.0 doc. (adrozdek)
This PR was submitted for the 4.3 branch but it was merged into the 3.4 branch instead (closes #33821).

Discussion
----------

Fixed invalid VarDumper upgrade-4.0 doc.

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

Updated upgrade-4.0 documentation to reflect actual changes in the code.

Commits
-------

afefc7104e Fixed invalid VarDumper upgrade doc.
2019-10-03 11:42:28 +02:00
Agata
afefc7104e Fixed invalid VarDumper upgrade doc. 2019-10-03 11:42:21 +02:00
Nicolas Grekas
e7f70415a5 bug #33814 [HttpFoundation] Check if data passed to SessionBagProxy::initialize is an array (mynameisbogdan)
This PR was submitted for the 4.3 branch but it was merged into the 3.4 branch instead (closes #33814).

Discussion
----------

[HttpFoundation] Check if data passed to SessionBagProxy::initialize is an array

[HttpFoundation] Check if data passed to SessionBagProxy::initialize is an array

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| 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 #33769 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
<!--
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 4.4.
 - Legacy code removals go to the master branch.
-->

If `$_SESSION['_sf2_attributes']` is set to a string, `SessionBagProxy::initialize` will throw an error since it's argument is type-hinted as array. So this change is to check before if the data to be passed is truly an array.

Commits
-------

38782bceff [HttpFoundation] Check if data passed to SessionBagProxy::initialize is an array
2019-10-02 18:15:28 +02:00
bogdan
38782bceff [HttpFoundation] Check if data passed to SessionBagProxy::initialize is an array 2019-10-02 18:15:21 +02:00
Justin Reherman
64aecab0a7
Don't let falsey usernames slip through 2019-10-02 10:20:10 -04:00
Christian Flothmann
fb5f8fb96a bug #33805 [FrameworkBundle] Fix wrong returned status code in ConfigDebugCommand (jschaedl)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] Fix wrong returned status code in ConfigDebugCommand

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

This is a follow-up PR caused by https://github.com/symfony/symfony/pull/33775#discussion_r330463216

Commits
-------

9b5ced20bb [FrameworkBundle] Fix wrong returned status code in ConfigDebugCommand
2019-10-02 14:13:41 +02:00
Jan Schädlich
9b5ced20bb [FrameworkBundle] Fix wrong returned status code in ConfigDebugCommand 2019-10-02 12:47:49 +02:00
Nicolas Grekas
db9ef8ae17 bug #33781 [AnnotationCacheWarmer] add RedirectController to annotation cache (jenschude)
This PR was submitted for the 4.3 branch but it was merged into the 3.4 branch instead (closes #33781).

Discussion
----------

[AnnotationCacheWarmer] add RedirectController to annotation cache

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #29357
| License       | MIT

This prevents to exclude the RedirectController from the warmed annotation cache which would lead to warnings when trying to use the warmed cache on read only file systems

Commits
-------

6b6c246c72 [AnnotationCacheWarmer] add RedirectController to annotation cache
2019-10-02 11:29:22 +02:00
Jens Schulze
6b6c246c72 [AnnotationCacheWarmer] add RedirectController to annotation cache
This prevents to exclude the RedirectController from the warmed annotation cache which would lead to warnings when trying to use the warmed cache on read only file systems

See #29357
2019-10-02 11:29:04 +02:00
Nicolas Grekas
ff194d9844 minor #33792 Sync Twig templateExists behaviors (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

Sync Twig templateExists behaviors

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

There are 5 places in the code that does the same check, but they are not consistent. The difficulty here is to support Twig 1, 2 & 3. I think relying on `Environment::MAJOR_VERSION` is OK. `method_exists` are useless IMO. The proof is that they are currenty missing in some of them.

Basically if Twig >= 2 -> the method `exists` exists on the loader so just call it.

For Twig 1, check `ExistsLoaderInterface`, then check for `SourceContextLoaderInterface`, then call `getSource()`.

Commits
-------

d7682fee6c Sync Twig templateExists behaviors
2019-10-02 10:32:14 +02:00