Commit Graph

30403 Commits

Author SHA1 Message Date
Markus Staab
e7d0787a4d [Finder] Fixed docs 2019-11-17 22:55:15 +01:00
Nardberjean
7b7f966711 Update HttpKernel.php 2019-11-17 21:23:00 +01:00
Mark Beech
bd0637ebe4 [HttpFoundation] Allow redirecting to URLs that contain a semicolon 2019-11-17 10:18:38 +01:00
Nicolas Grekas
eaca085aa4 [SecurityBundle] fix failing test 2019-11-16 16:50:51 +01:00
Jérémie Broutier
51c5f69274 Fix MySQL column type definition.
Fix wrong MySQL column type definition causing Numeric value out of range exception.

Ref #34409
2019-11-16 12:41:30 +01:00
Damien Alexandre
e6c9d77b63
[Finder] Allow ssh2 stream wrapper for sftp
Same fix as #28604 but for the ss2.sftp wrapper.
2019-11-15 15:28:29 +01:00
Thomas Calvet
78dad79fec [WebProfilerBundle] Require symfony/twig-bundle 2019-11-14 16:04:06 +01:00
Fabien Potencier
8a68d2d358 bumped Symfony version to 3.4.36 2019-11-13 09:48:47 +01:00
Fabien Potencier
02257c8098 updated VERSION for 3.4.35 2019-11-13 09:44:50 +01:00
Nicolas Grekas
32bde39f63 bug #34344 [Console] Constant STDOUT might be undefined (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console] Constant STDOUT might be undefined

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

Commits
-------

bb8c82c0b5 [Console] Constant STDOUT might be undefined.
2019-11-13 08:27:07 +01:00
Nicolas Grekas
53dc781814 minor #34340 Allow returning null from NormalizerInterface::normalize (teohhanhui)
This PR was merged into the 3.4 branch.

Discussion
----------

Allow returning null from NormalizerInterface::normalize

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

Looking at the code, it seems that a normalizer might be called with a `null` value for `$data`, and thus it's only sensible that it be allowed to return `null` too:

7064ff35f2/src/Symfony/Component/Serializer/Serializer.php (L141-L148)

Updating the phpdoc to match.

Commits
-------

1c8edc55ad Allow returning null from NormalizerInterface::normalize
2019-11-13 08:26:33 +01:00
Nicolas Grekas
bb8c82c0b5 [Console] Constant STDOUT might be undefined. 2019-11-13 08:12:39 +01:00
Teoh Han Hui
1c8edc55ad
Allow returning null from NormalizerInterface::normalize 2019-11-12 18:51:12 +01:00
Nicolas Grekas
4cc37df2fb security #cve-2019-18889 [Cache] forbid serializing AbstractAdapter and TagAwareAdapter instances (nicolas-grekas)
This PR was merged into the 3.4 branch.
2019-11-12 13:50:33 +01:00
Nicolas Grekas
b21025b139 security #cve-2019-18888 [HttpFoundation] fix guessing mime-types of files with leading dash (nicolas-grekas)
This PR was merged into the 3.4 branch.
2019-11-12 13:49:04 +01:00
Nicolas Grekas
010213408e security #cve-2019-18887 [HttpKernel] Use constant time comparison in UriSigner (stof)
This PR was merged into the 3.4 branch.
2019-11-12 13:47:53 +01:00
Nicolas Grekas
7064ff35f2 [Workflow] fix lowest dep 2019-11-12 11:06:38 +01:00
Fabien Potencier
a4c4f00e17 bumped Symfony version to 3.4.35 2019-11-11 17:24:44 +01:00
Fabien Potencier
d7601fa827 updated VERSION for 3.4.34 2019-11-11 17:11:23 +01:00
Nicolas Grekas
6be5cc75a4 [HttpFoundation] fix guessing mime-types of files with leading dash 2019-11-11 13:53:10 +01:00
Fabien Potencier
4463791d0e minor #34299 [Routing] revert the return type for UrlGeneratorInterface::generate to remove null (shieldo)
This PR was merged into the 3.4 branch.

Discussion
----------

[Routing] revert the return type for UrlGeneratorInterface::generate to remove null

…to remove null

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

Bit of a casualty of commit tennis this:

A change to add `null` here as an option for how `UrlGeneratorInterface::generate()` (rather than the concrete `UrlGenerator`) was merged in https://github.com/symfony/symfony/pull/28321, but then [reverted](90494c20cc) for the reason [that this could be seen as a BC break](https://github.com/symfony/symfony/pull/28321#issuecomment-418540080), as the `null` return had not previously been documented (and is still not as part of the interface method docs).

However, in a subsequent change (https://github.com/symfony/symfony/pull/33252) with a wider scope, this doc change was added _back_ in order to reflect the underlying implementation as a result of a PHPStorm plugin complaining. There's no indication though of what a `null` return here though would mean, and for the same reason as the first revert (that this should be seen as a BC break), I'd like to submit this to be reverted for the 3.4 branch. (In 4.4 the `null` has already been removed.)

Having the interface indicating that this method can return `null` necessitates introducing a lot of actually redundant null checks in code that is covered by static analysis tools such as PHPStan.

Commits
-------

9f853f324f [Routing] revert the return type for UrlGeneratorInterface::generate to remove null
2019-11-09 07:39:26 +01:00
Douglas Greenshields
9f853f324f
[Routing] revert the return type for UrlGeneratorInterface::generate to remove null 2019-11-08 17:25:00 +00:00
Nicolas Grekas
dad4344793 [DI] fix locators with numeric keys 2019-11-08 17:18:30 +01:00
Nicolas Grekas
1606430cfd [DI] Dont cache classes with missing parents 2019-11-08 09:28:59 +01:00
Fabien Potencier
9151698d85 minor #34135 [Validator] Add the missing translations for the Hebrew ("he") locale and fix 2 typos (Tamarpe)
This PR was squashed before being merged into the 3.4 branch (closes #34135).

Discussion
----------

[Validator] Add the missing translations for the Hebrew ("he") locale and fix 2 typos

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

Ref #30166

Commits
-------

022cf67f19 [Validator] Add the missing translations for the Hebrew (\"he\") locale and fix 2 typos
2019-11-05 23:03:38 +01:00
tamar peled
022cf67f19 [Validator] Add the missing translations for the Hebrew (\"he\") locale and fix 2 typos 2019-11-05 23:03:33 +01:00
Nicolas Grekas
a2bccc6910 minor #33950 [FrameworkBundle] Avoid using of kernel after shutdown in KernelTestCase (alexander-schranz)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] Avoid using of kernel after shutdown in KernelTestCase

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #...
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

I had sadly something like this in my codebase:

```php
if (!static::$kernel) {
    static::bootKernel();
}
```

As the $kernel is never set again to null a old $kernel was still there. I would not only set the $container also the $kernel variable to null. ~~As this could be a BC Break I'm targeting master~~.

Commits
-------

49b58ed45e Avoid using of kernel after shutdown
2019-11-05 15:21:40 +01:00
Chi-teck
bd1ead251c [DependencyInjection] Fix broken references in tests 2019-11-04 20:58:26 +01:00
Alexander Schranz
49b58ed45e Avoid using of kernel after shutdown 2019-11-03 20:32:26 +01:00
Fabien Potencier
0af10ccd0d minor #34160 Adding some validations tags on validators.et.xlf (glodzienski)
This PR was merged into the 3.4 branch.

Discussion
----------

Adding some validations tags on validators.et.xlf

| Q             | A
| ------------- | ---
| Branch?       | 4.4 for features / 3.4 or 4.3 for bug fixes <!-- see below -->
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/30160
| License       | MIT

I saw an issue in the **Issues Page** and i want to help to improve the repository, even with a simple modification

Commits
-------

16bd71b5b1 Adding some validations tags on validators.et.xlf
2019-11-03 18:41:53 +01:00
Fabien Potencier
78bdf1a307 minor #34153 [Validator] add missing translation for 94 (it) (garak)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] add missing translation for 94 (it)

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

Italian translation for validator is missing last item (id 94)

Commits
-------

1dc7ce1159 add missing translation for 94 (it)
2019-11-03 18:21:08 +01:00
Fabien Potencier
9162892fd4 bug #34181 [Stopwatch] Fixed bug in getDuration when counting multiple ongoing periods (TimoBakx)
This PR was merged into the 3.4 branch.

Discussion
----------

[Stopwatch] Fixed bug in getDuration when counting multiple ongoing periods

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

When running multiple periods in StopwatchEvent (start multiple times and not stop them all), the getDuration() method would return unexpected values.

This was because at every stop, the last entry in the `started` array was removed, while the `getDuration` method was still expecting all the started events to still be there.

Now, when calling `getDuration`, the duration of all the finished periods are added together with the unfinished counts.

Commits
-------

af00d8deab [Stopwatch] Fixed bug in getDuration when counting multiple ongoing periods
2019-11-03 18:17:59 +01:00
Fabien Potencier
767b265681 bug #34179 [Stopwatch] Fixed a bug in StopwatchEvent::getStartTime (TimoBakx)
This PR was merged into the 3.4 branch.

Discussion
----------

[Stopwatch] Fixed a bug in StopwatchEvent::getStartTime

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

When using a `StopwatchEvent` with an `$origin` that's smaller than the first start time, calling `getStartTime()` before ending the event will give `0` instead of the correct number.

The proposed fix in #34088 fixes this.

Commits
-------

b2b7eab949 [Stopwatch] Fixed a bug in stopwatch event getStartTime
2019-11-03 13:11:53 +01:00
Eric Schildkamp
613717d71f [FrameworkBundle] [HttpKernel] fixed correct EOL and EOM month
* Added a hardcoded day 01 in order to output the proper month November
which is the correct EOL and EOM month.
* \DateTime::createFromFormat('mY') will output December for every month
where day 31 exists.
2019-11-03 13:06:33 +01:00
HypeMC
51b20dd895 Fix MockFileSessionStorageTest::sessionDir being used after it's unset 2019-11-03 03:12:45 +01:00
Fabien Potencier
36c4c66a60 bumped Symfony version to 3.4.34 2019-11-01 10:59:17 +01:00
Fabien Potencier
a3ae48695d updated VERSION for 3.4.33 2019-11-01 10:46:31 +01:00
Timo Bakx
b2b7eab949 [Stopwatch] Fixed a bug in stopwatch event getStartTime 2019-10-30 14:03:57 +01:00
Nicolas Grekas
27b0baa270 bug #33998 [Config] Disable default alphabet sorting in glob function due of unstable sort (hurricane-voronin)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Config] Disable default alphabet sorting in glob function due of unstable sort

…table sort

| Q             | A
| ------------- | ---
| Branch?       | 3.4  <!-- 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       | Fix #33990  <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | no <!-- required for new features -->

`\Symfony\Component\Config\Resource\GlobResource::getIterator` loads files using `glob` not it the stable sorting, e.g several files: `doctrine.yml` and `doctrine_mongodb.yaml` in `config/packages` folder.
On requests these files come(randomly) in a different order, which leads to reinitialization of symfony kernel in `dev` environment. It's a little bit annoying and takes a lot of time in a common :(

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

3bed0247c0 [Config] Disable default alphabet sorting in glob function due of unstable sort
2019-10-30 13:46:47 +01:00
Denys Voronin
3bed0247c0 [Config] Disable default alphabet sorting in glob function due of unstable sort 2019-10-30 13:43:22 +01:00
Timo Bakx
af00d8deab [Stopwatch] Fixed bug in getDuration when counting multiple ongoing periods 2019-10-29 21:16:34 +01:00
Thomas Calvet
ad2ce276c7 [Serializer] Improve messages for unexpected resources values 2019-10-29 12:09:57 +01:00
Glodzienski
16bd71b5b1
Adding some validations tags on validators.et.xlf 2019-10-28 21:40:18 -03:00
Robin Chalas
2ecd7936b1 bug #34080 [SecurityBundle] correct types for default arguments for firewall configs (shieldo)
This PR was merged into the 3.4 branch.

Discussion
----------

[SecurityBundle] correct types for default arguments for firewall configs

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

Up until now, the default template arguments in the `security.firewall.config` abstract service definition have been each defined (aside from the argument for `$listeners` which is given a `collection` type) in the XML as

```xml
<argument />
```

which resolves to an empty string, despite that some of the arguments are typed to being either `bool` or `array|null` on the `Symfony\Bundle\SecurityBundle\Security\FirewallConfig` class itself.

This wouldn't be so much of a problem if the child definitions that use this as a template overrode all the arguments every time, but in the case of firewall configs that mark security as _not_ being enabled, [only the first few arguments are overwritten](https://github.com/symfony/symfony/blob/3.4/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php#L349-L352), so firewall config objects that do not have security enabled are instantiated by the DI container with parameters with some of the wrong types.

In general this wouldn't be an issue, as firewalls with security not enabled would not usually be consumed in a context where further security-related config were needed, but there is a case in `Symfony\Bundle\SecurityBundle\DataCollector\SecurityDataCollector` where the method `getSwitchUser()` on the firewall config object [can be called](https://github.com/symfony/symfony/blob/3.4/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php#L181) without checking first whether the firewall has security enabled, which leads to an exception being thrown:

```
Symfony\Component\Debug\Exception\ContextErrorException
Warning: Illegal string offset 'parameter'
in vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php (line 184)
```

which is down to the firewall config being set with an empty string rather than `null` (in which case the logic here would function as expected).

It seemed most appropriate as a fix (especially given possible introduction of scalar type hints in the future) to apply types to the default arguments so that it was no longer possible to instantiate a firewall config object with parameters of unexpected types.

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

6b7044fc01 [SecurityBundle] correct types for default arguments for firewall configs
2019-10-28 18:20:44 +01:00
Massimiliano Arione
1dc7ce1159
add missing translation for 94 (it) 2019-10-28 16:39:28 +01:00
Yonel Ceruto
fb70e0af8d minor #30442 [OptionsResolver] Fix an error message to be more accurate (dimabory)
This PR was merged into the 3.4 branch.

Discussion
----------

[OptionsResolver] Fix an error message to be more accurate

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

See #30432 for more details:
> **Symfony version(s) affected**: 3.4, maybe other versions too (not tested)
>
> **Description**
> Error message when allowedTypes is an array contains `[]` but should not:
> `The option "testme" with value array is expected to be of type "string[]", but one of the elements is of type "integer[]".`
> It should be:
> `The option "testme" with value array is expected to be of type "string[]", but one of the elements is of type "integer".`
>
> **How to reproduce**
>
> ```
> $resolver = (new OptionsResolver())
>     ->setDefault('testme', [])
>     ->setAllowedTypes('testme', ['string[]'])
>     ->resolve(['testme' => ['test', 12]]);
> ```

In addition I changed an error message to be more
accurate if provided more than one incorrect value:
> [...] is expected to be of type "integer[][]", but is of type "integer|boolean|string".

Commits
-------

7fa2fc2 #30432 fix an error message
2019-10-26 07:18:38 -04:00
Dmytro
7fa2fc2b96 #30432 fix an error message 2019-10-26 07:02:01 -04:00
Yonel Ceruto
2a5c75582e bug #33999 [Form] Make sure to collect child forms created on *_SET_DATA events (yceruto)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] Make sure to collect child forms created on *_SET_DATA events

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

See reproducer provided by @WubbleWobble https://github.com/WubbleWobble/symfony-issue-29291.

Commits
-------

50efc1a Make sure to collect child forms created on *_SET_DATA events
2019-10-26 06:32:38 -04:00
Tobias Schultze
c953ba88d7 minor #34097 [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4 (alexpott)
This PR was squashed before being merged into the 3.4 branch (closes #34097).

Discussion
----------

[Validator] Ensure numeric subpaths do not cause errors on PHP 7.4

| 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 #... <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Drupal is testing on PHP7.4 and hitting a problem with the line `if ('[' === $subPath[0]) {` because `$subPath` is not a string. We're already doing string casting in the method so we could do it once and be done. Note this is not a problem on the master branch / SF5 because of primitive typehinting.

Without this fix on PHP7.4 you see errors like...
```
1) Symfony\Component\Validator\Tests\Util\PropertyPathTest::testAppend with data set #5 ('0', 1, '0.1', 'Numeric subpaths do not cause...rrors.')
Trying to access array offset on value of type int
```

Commits
-------

6244a1ec47 [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4
2019-10-25 15:07:00 +02:00
Alex Pott
6244a1ec47 [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4 2019-10-25 15:06:49 +02:00