Commit Graph

44158 Commits

Author SHA1 Message Date
Thomas Calvet
3a840a9796 [Routing] Fix using a custom matcher & generator dumper class 2020-01-08 15:00:15 +01:00
Nicolas Grekas
1e4e0ec979 minor #35250 [HttpClient] Added missing sprintf (TiGR)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] Added missing sprintf

It was supposed to be there.

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

Commits
-------

08c1481b88 [HttpClient] Added missing sprintf
2020-01-07 22:30:00 +01:00
Igor Tarasov
08c1481b88
[HttpClient] Added missing sprintf
It was supposed to be there.
2020-01-07 23:22:51 +03:00
Fabien Potencier
47a866bf7b bug #35150 [Messenger] Added check if json_encode succeeded (toooni)
This PR was squashed before being merged into the 4.3 branch (closes #35150).

Discussion
----------

[Messenger] Added check if json_encode succeeded

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

Similar PR as https://github.com/symfony/symfony/pull/35137 but for branch 4.3.

When trying to add a message to redis transport which can not be encoded with `json_encode` there is now a `TransportException` containing the `json_last_error_msg` as the message.
I had an issue where I tried to send an email through messenger by symfony mailer which contains a pdf attachment. Instead of an error while sending i got an error `Encoded envelope should have at least a "body"` which happened because the encoded message was `false`.

This is not exactly a bugfix, but IMO also not a feature worth being mentioned in the changelog so I am not sure I've filled out the Q/A correctly.

Commits
-------

c2bdc4c4d3 [Messenger] Added check if json_encode succeeded
2020-01-07 20:21:24 +01:00
Toni Rudolf
c2bdc4c4d3 [Messenger] Added check if json_encode succeeded 2020-01-07 20:21:19 +01:00
Fabien Potencier
de34f229a9 minor #35213 [Security\Guard] Fix missing typehints (chalasr)
This PR was merged into the 4.3 branch.

Discussion
----------

[Security\Guard] Fix missing typehints

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

Commits
-------

2ef8771ad7 [Security\Guard] Fix missing typehints
2020-01-07 20:10:35 +01:00
Nicolas Grekas
f9b36c754d bug #35223 [HttpClient] Don't read from the network faster than the CPU can deal with (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] Don't read from the network faster than the CPU can deal with

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

Something I spotted while working on #35115: both the curl and native clients don't play well with heavily compressed HTTP streams: they decompress faster than userland can process chunks.

The attached patch moves the decompression logic to the chunk generator. This means internally we only deal with raw compressed chunks, and they are decompressed only when passing the value to userland.

Commits
-------

ac3d77a76a [HttpClient] Don't read from the network faster than the CPU can deal with
2020-01-06 13:56:11 +01:00
Nicolas Grekas
6fb2d52077 bug #35214 [DI] DecoratorServicePass should keep container.service_locator on the decorated definition (malarzm)
This PR was merged into the 4.3 branch.

Discussion
----------

[DI] DecoratorServicePass should keep container.service_locator on the decorated definition

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix https://github.com/symfony/symfony/pull/33670#issuecomment-569917301
| License       | MIT
| Doc PR        | -

`container.service_locator` is special because it tells how the arguments of the constructor should be interpreted.

/cc @malarzm

Commits
-------

99dab87ada [DI] DecoratorServicePass should keep container.service_locator on the decorated definition
2020-01-06 13:55:46 +01:00
Nicolas Grekas
ac3d77a76a [HttpClient] Don't read from the network faster than the CPU can deal with 2020-01-06 10:53:56 +01:00
Maciej Malarz
99dab87ada [DI] DecoratorServicePass should keep container.service_locator on the decorated definition 2020-01-04 20:22:46 +01:00
Robin Chalas
2ef8771ad7 [Security\Guard] Fix missing typehints 2020-01-04 19:57:41 +01:00
Nicolas Grekas
ccfc4b67b3 bug #35210 [HttpClient] NativeHttpClient should not send >1.1 protocol version (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] NativeHttpClient should not send >1.1 protocol version

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

Commits
-------

8b61c95685 [HttpClient] NativeHttpClient should not send >1.1 protocol version
2020-01-04 15:04:26 +01:00
Nicolas Grekas
8b61c95685 [HttpClient] NativeHttpClient should not send >1.1 protocol version 2020-01-04 15:00:37 +01:00
Nicolas Grekas
eb5171f059 bug #33672 [Mailer] Remove line breaks in email attachment content (Stuart Fyfe)
This PR was squashed before being merged into the 4.3 branch.

Discussion
----------

[Mailer] Remove line breaks in email attachment content

Line breaks are not allowed in attachment content when sending over the
API.

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #33671, Closes #32645
| License       | MIT
| Doc PR        |

This is a fix for #33671. Send grid's API throws a 400 error when sending email attachments with default base64 encoding.
Removing the line breaks resolves this issue.

Commits
-------

a28a7f9dee [Mailer] Remove line breaks in email attachment content
2020-01-04 13:46:16 +01:00
Stuart Fyfe
a28a7f9dee [Mailer] Remove line breaks in email attachment content 2020-01-04 13:45:40 +01:00
Nicolas Grekas
423d3ddf05 bug #35101 [Routing] Fix i18n routing when the url contains the locale (fancyweb)
This PR was merged into the 4.3 branch.

Discussion
----------

[Routing] Fix i18n routing when the url contains the locale

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

This PR fixes different scenarios with i18n routing.

Commits
-------

cd40bb8604 [Routing] Fix i18n routing when the url contains the locale
2020-01-04 13:43:28 +01:00
Nicolas Grekas
cbf2abdece bug #35124 [TwigBridge][Form] Added missing help messages in form themes (cmen)
This PR was merged into the 4.3 branch.

Discussion
----------

[TwigBridge][Form] Added missing help messages in form themes

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

Results:
![b3](https://user-images.githubusercontent.com/8505069/71522117-a9292080-28c3-11ea-86cd-0f257d50267d.png)

![b3h](https://user-images.githubusercontent.com/8505069/71522118-acbca780-28c3-11ea-95d7-9931442160dd.png)

![b4](https://user-images.githubusercontent.com/8505069/71522119-af1f0180-28c3-11ea-8559-02f69efcd2ef.png)

![b4h](https://user-images.githubusercontent.com/8505069/71522121-b219f200-28c3-11ea-86d7-abd192ed33ad.png)

![f](https://user-images.githubusercontent.com/8505069/71522126-b5ad7900-28c3-11ea-8300-3b52258da84b.png)

Commits
-------

5374d4f210 [TwigBridge][Form] Added missing help messages in form themes
2020-01-04 13:39:07 +01:00
Nicolas Grekas
cf83c608d3 bug #35168 [HttpClient] fix capturing SSL certificates with NativeHttpClient (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] fix capturing SSL certificates with NativeHttpClient

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

Commits
-------

234589a753 [HttpClient] fix capturing SSL certificates with NativeHttpClient
2020-01-04 13:28:10 +01:00
Nicolas Grekas
d394214b72 minor #35155 Update year in license files (rosier)
This PR was merged into the 4.3 branch.

Discussion
----------

Update year in license files

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

Happy new year new components ;-)

Commits
-------

0d7a8bdd0a Update year in license files
2020-01-04 13:25:35 +01:00
Nicolas Grekas
a56c3ef85c Merge branch '3.4' into 4.3
* 3.4:
  Update links to documentation
  [Validator] Add the missing translations for the Arabic (ar) locale
  ensure to expect no validation for the right reasons
  [PhpUnitBridge] Add test case for @expectedDeprecation annotation
  Update year in license files
  [Console][FormatterHelper] Use helper strlen statically and remove duplicated code
  Fix BC issue in phpDoc Reflection library
  [Translator] Performance improvement in MessageCatalogue and catalogue operations.
2020-01-04 13:24:57 +01:00
Nicolas Grekas
4b419f2706 minor #35074 Update links to documentation (shahariaazam)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead.

Discussion
----------

Update links to documentation

Security homepage URL has been updated for documentation

Commits
-------

5cac29571b Update links to documentation
2020-01-04 13:06:31 +01:00
Shaharia Azam
5cac29571b Update links to documentation 2020-01-04 13:05:51 +01:00
Nicolas Grekas
28e502ec49 bug #35134 [PropertyInfo] Fix BC issue in phpDoc Reflection library (jaapio)
This PR was merged into the 3.4 branch.

Discussion
----------

[PropertyInfo] Fix BC issue in phpDoc Reflection library

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

The used phpDocumentor library DocBlockReflection contained a BC break
that broke this component. The patch was applied in the recently released v4.3.4
version. But since it is unclear how long this issue existed it is not possible
to exclude a certain version. Therefor also `\RuntimeExpception` needs to be caught.

The BC break is possibly caused by a change in the TypeResolver library used by the
DocBlockReflection which is now supporting the more popular generics notation for arrays.

This PR might need some tests but the current test cases are not very clear to me. Instead of patching the code we could also try to ban the broken versions of the used phpdoc libraries, but that would require much more testing, and doesn't really add any value. Especially because the DocBlockReflection and TypeResolver are used by over half a million projects. It would raise more questions than just patching the behavior of the PropertyInfo component.

We are sorry that this issue slipt through our QA pipeline. The linked issue already showed that the issue is now fixed by just doing a `composer update` but it is not very convenient to leave this known issue in symfony.

Commits
-------

bad07ec557 Fix BC issue in phpDoc Reflection library
2020-01-04 13:01:51 +01:00
Nicolas Grekas
8c7b1c85f0 minor #35147 [Validator] Add the missing translations for the Arabic (ar) locale (Ahmed Raafat)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead.

Discussion
----------

[Validator] Add the missing translations for the Arabic (ar) locale

| Q             | A
| ------------- | ---
| Branch?       | master
| Bugfix?      |  no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #35126
| License       | MIT

### Changes:
This a basic PR to add the missing Validator translations for AR Locale.

* I'm an Arabic speaking so the changes here should be correct and valid.

Commits
-------

da117714fd [Validator] Add the missing translations for the Arabic (ar) locale
2020-01-04 13:00:52 +01:00
Ahmed Raafat
da117714fd [Validator] Add the missing translations for the Arabic (ar) locale 2020-01-04 13:00:45 +01:00
Nicolas Grekas
9392f76519 minor #35207 [Form] ensure to expect no validation for the right reasons (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] ensure to expect no validation for the right reasons

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

Commits
-------

8d46f95f4c ensure to expect no validation for the right reasons
2020-01-04 12:55:48 +01:00
Nicolas Grekas
51d8070960 minor #35154 Update year in license files (rosier)
This PR was merged into the 3.4 branch.

Discussion
----------

Update year in license files

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

Happy new year to everyone

Commits
-------

889a110e74 Update year in license files
2020-01-04 12:53:32 +01:00
Nicolas Grekas
db874f6cd8 minor #35188 [PhpUnitBridge][SymfonyTestsListenerTrait] Remove $testsWithWarnings stack (fancyweb)
This PR was merged into the 4.3 branch.

Discussion
----------

[PhpUnitBridge][SymfonyTestsListenerTrait] Remove $testsWithWarnings stack

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

As far as I can see, it is unused since 4.0.

Commits
-------

50ba566c0b [PhpUnitBridge][SymfonyTestsListenerTrait] Remove $testsWithWarnings stack
2020-01-04 12:19:20 +01:00
Nicolas Grekas
28c9463207 minor #35190 [PhpUnitBridge] Add test case for @expectedDeprecation annotation (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[PhpUnitBridge] Add test case for @expectedDeprecation annotation

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

Useful twice because it also tests the fact that a test that expects a deprecation and that does not perform any assertion is not considered risky.

Commits
-------

dba1804f5d [PhpUnitBridge] Add test case for @expectedDeprecation annotation
2020-01-04 12:18:41 +01:00
Christian Flothmann
8d46f95f4c ensure to expect no validation for the right reasons 2020-01-04 10:13:45 +01:00
Thomas Calvet
dba1804f5d [PhpUnitBridge] Add test case for @expectedDeprecation annotation 2020-01-03 12:33:57 +01:00
Thomas Calvet
50ba566c0b [PhpUnitBridge][SymfonyTestsListenerTrait] Remove $testsWithWarnings stack 2020-01-03 11:53:28 +01:00
Fabien Potencier
e348513157 bug #35173 [Mailer][MailchimpBridge] Fix missing attachments when sending via Mandrill API (vilius-g)
This PR was merged into the 4.3 branch.

Discussion
----------

[Mailer][MailchimpBridge] Fix missing attachments when sending via Mandrill API

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

Previous code tries to pass attachments to API, but uses incorrect structure and as a result all attachments are missing when the email is sent.

This also adds previously missing attachment names.

Commits
-------

7b1bbb6190 [Mailer][MailchimpBridge] Fix missing attachments when sending via Mandrill API
2020-01-02 19:35:45 +01:00
Fabien Potencier
08670cc85b bug #35172 [Mailer][MailchimpBridge] Fix incorrect sender address when sender has name (vilius-g)
This PR was merged into the 4.3 branch.

Discussion
----------

[Mailer][MailchimpBridge] Fix incorrect sender address when sender has name

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

This fixes the same problem as https://github.com/symfony/symfony/commit/6dbac13a07c23f321b04489b6a9773 but for HTTP transport.

I am also not sure that `from_email` parameter is needed here at all as it is optional for this API call.

Commits
-------

9e12a6dcda [Mailer][MailchimpBridge] Fix incorrect sender address when sender has name
2020-01-02 19:34:14 +01:00
Vilius Grigaliūnas
7b1bbb6190 [Mailer][MailchimpBridge] Fix missing attachments when sending via Mandrill API
Previous code tries to pass attachments to API, but uses incorrect structure and as a result all attachments are missing when the email is sent.
2020-01-02 17:40:32 +02:00
Vilius Grigaliūnas
9e12a6dcda [Mailer][MailchimpBridge] Fix incorrect sender address when sender has name
This fixes the same problem as https://github.com/symfony/symfony/commit/6dbac13a07c23f321b04489b6a9773 but for HTTP transport.
2020-01-02 17:01:57 +02:00
Nicolas Grekas
234589a753 [HttpClient] fix capturing SSL certificates with NativeHttpClient 2020-01-02 11:45:17 +01:00
Christophe Meneses
5374d4f210 [TwigBridge][Form] Added missing help messages in form themes 2020-01-01 13:53:32 +01:00
Jan Rosier
0d7a8bdd0a Update year in license files 2020-01-01 12:51:43 +01:00
Jan Rosier
889a110e74 Update year in license files 2020-01-01 12:03:25 +01:00
Nicolas Grekas
8e9aafc84f bug #35125 [Translator] fix performance issue in MessageCatalogue and catalogue operations (ArtemBrovko)
This PR was merged into the 3.4 branch.

Discussion
----------

[Translator] fix performance issue in MessageCatalogue and catalogue operations

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

In our project we use lots of catalogue operations during importing of translations to our system and we ran into performance issue. Code profiler showed lots or `array_replace` calls in  [MessageCatalogue::add](https://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/Translation/MessageCatalogue.php#L128) method. This method is actually called by [MessageCatalogue::set](https://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/Translation/MessageCatalogue.php#L70), which is quite an overkill, because `MessageCatalogue::set` is meant to set only one translation at a time. Method was reworked. `MergeOperation` and `TargetOperation` was reworked as well to use this improved `MessageCatalogue::set` method instead of constructing array with only one translation and passing it to `MessageCatalogue::add` method.

Table shows execution time before and after

|  | Time in seconds (avg. of 10 executions)
----------- | ------
Before | 50
After | 8

Looks like 4.* and 5.* versions can also be improved by the same changes.
<!--
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.
-->

Commits
-------

5179af4796 [Translator] Performance improvement in MessageCatalogue and catalogue operations.
2019-12-31 15:31:48 +01:00
Nicolas Grekas
c9767520d5 minor #35141 [Console][FormatterHelper] Use helper strlen statically and remove duplicated code (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console][FormatterHelper] Use helper strlen statically and remove duplicated code

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

All those helpers methods are static and are accessed with `self::` everywhere else. They are not an extension point.

Commits
-------

f0d227db2f [Console][FormatterHelper] Use helper strlen statically and remove duplicated code
2019-12-31 15:27:06 +01:00
Nicolas Grekas
3a51e0143a minor #35148 [HttpClient] fix typo (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] fix typo

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

Commits
-------

3a25878e98 [HttpClient] fix typo
2019-12-31 15:25:38 +01:00
Nicolas Grekas
3a25878e98 [HttpClient] fix typo 2019-12-30 18:19:47 +01:00
Thomas Calvet
f0d227db2f [Console][FormatterHelper] Use helper strlen statically and remove duplicated code 2019-12-29 18:51:53 +01:00
Thomas Calvet
cd40bb8604 [Routing] Fix i18n routing when the url contains the locale 2019-12-29 11:48:40 +01:00
Jaapio
bad07ec557
Fix BC issue in phpDoc Reflection library
The used phpDocumentor library DocBlockReflection contained an BC break
that broke this component. The patch was applied in the recent released v4.3.4
version. But since it is unclear how long this issue existed it is not possible
to exclude a certain version. Therefor also `\RuntimeExpception` needs to be catched.

The BC break is possibly caused by a change in the TypeResolver library used by the
DocBlockReflection which is now supporting the more populair generics notation for arrays.
2019-12-28 22:02:19 +01:00
Artem Brovko
5179af4796 [Translator] Performance improvement in MessageCatalogue and catalogue operations. 2019-12-28 16:59:49 +02:00
Nicolas Grekas
f3d8fd2521 bug #35120 [HttpClient] fix scheduling pending NativeResponse (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] fix scheduling pending NativeResponse

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

There must be one pending list per `ResponseStream` instance.
Currently, we start unrelated responses and this can lead to broken iterators when the unrelated response throws because it is a 3/4/5xx.

Commits
-------

a90a6c9c48 [HttpClient] fix scheduling pending NativeResponse
2019-12-28 15:54:06 +01:00
Nicolas Grekas
b6403d88c2 bug #35117 [Cache] do not overwrite variable value (xabbuh)
This PR was merged into the 4.3 branch.

Discussion
----------

[Cache] do not overwrite variable value

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

Commits
-------

e379dbbf21 do not overwrite variable value
2019-12-28 15:53:10 +01:00