Commit Graph

50507 Commits

Author SHA1 Message Date
Fabien Potencier
9ab652d60c Merge branch '3.4' into 4.4
* 3.4:
  [Validator] Add Lithuanian translation for ISIN constraint
2020-08-21 11:47:32 +02:00
Christian Flothmann
6cffc79de6 properly choose the best mailer message logger listener 2020-08-21 11:20:36 +02:00
Fabien Potencier
a80dbc5309 feature #37889 Toolbar toggler accessibility (Chi-teck)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

Toolbar toggler accessibility

| Q             | A
| ------------- | ---
| Branch       | master
| Bug fix      | yes
| New feature  | no
| Deprecations |no
| Tickets       | Fix #37739
| License       | MIT

Commits
-------

4333dd0ac9 Toolbar toggler accessibility
2020-08-21 08:53:22 +02:00
Chi-teck
4333dd0ac9 Toolbar toggler accessibility 2020-08-21 08:53:16 +02:00
Fabien Potencier
c3ce47e669 Fixed CS 2020-08-21 08:52:49 +02:00
Fabien Potencier
e98fdc7073 feature #36515 [HttpKernel] Add $kernel->getBuildDir() to separate it from the cache directory (mnapoli)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[HttpKernel] Add `$kernel->getBuildDir()` to separate it from the cache directory

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no
| Tickets       | Fix #23354
| 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/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 master.
-->

In order to support deploying on read-only filesystems (e.g. AWS Lambda in my case), I have started implementing #23354.

This introduces `$kernel->getBuildDir()`:

- `$kernel->getBuildDir()`: for cache that can be warmed and deployed as read-only (compiled container, annotations, etc.)
- `$kernel->getCacheDir()`: for cache that can be written at runtime (e.g. cache pools, session, profiler, etc.)

I have probably missed some places or some behavior of Symfony that I don't know. Don't consider this PR perfect, but rather I want to help move things forward :)

TODO:

- [ ] Changelog
- [ ] Upgrade guide
- [ ] Documentation

Commits
-------

ec945f10d8 [HttpKernel] Add `$kernel->getBuildDir()` to separate it from the cache directory
2020-08-21 08:43:41 +02:00
Matthieu Napoli
ec945f10d8 [HttpKernel] Add $kernel->getBuildDir() to separate it from the cache directory 2020-08-21 08:43:34 +02:00
Fabien Potencier
91dc9c7083 Fix CS 2020-08-21 08:40:21 +02:00
Fabien Potencier
af91bf849a bug #37899 [Mailer] Support reply-to in SesApiAsyncAwsTransport (cvmiert)
This PR was merged into the 5.1 branch.

Discussion
----------

[Mailer] Support reply-to in SesApiAsyncAwsTransport

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

Enable sending `SendEmailRequest`s with reply-to addresses with `SesApiAsyncAwsTransport`.

Commits
-------

163e961b44 [Mailer] Support reply-to in SesApiAsyncAwsTransport
2020-08-21 08:36:53 +02:00
Fabien Potencier
1f4c61683e bug #37900 [Mailer] Fixed mandrill api header structure (wulff)
This PR was submitted for the 5.1 branch but it was squashed and merged into the 4.4 branch instead.

Discussion
----------

[Mailer] Fixed mandrill api header structure

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

When using the Mandrill API transport, it is not possible to set a reply-to address.

**How to reproduce**
Create a new email and add a reply-to address:

```php
$email = (new Email())
    ->from('from@example.com')
    ->to('to@example.com')
    ->replyTo('replyto@example.com')
    ->subject('subject')
    ->text('text');
$mailer->send($email);
```

The expected result is a payload which contains the following headers:

```
"headers": {
    "reply-to": "replyto@example.com"
}
```

But instead, the `getPayload()` method produces these headers:

```
"headers": [
    "reply-to: replyto@example.com"
]
```

**Additional context**
See https://mandrillapp.com/api/docs/messages.html.

Commits
-------

aeb4c5e6c7 [Mailer] Fixed mandrill api header structure
2020-08-21 08:31:54 +02:00
wulff
aeb4c5e6c7 [Mailer] Fixed mandrill api header structure 2020-08-21 08:31:47 +02:00
Clara van Miert
163e961b44
[Mailer] Support reply-to in SesApiAsyncAwsTransport
Enable sending `SendEmailRequest`s with reply-to addresses with
`SesApiAsyncAwsTransport`.
2020-08-20 19:12:17 +02:00
Fabien Potencier
f1437be944 minor #37895 [HttpClient][ResponseTrait] Fix typo (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient][ResponseTrait] Fix typo

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

Commits
-------

cbd8ca0625 [HttpClient][ResponseTrait] Fix typo
2020-08-20 15:33:51 +02:00
Fabien Potencier
890f8f0c78 bug #37891 [Mailer] Mailjet - properly format Cc and Bcc for API (tcheymol)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Mailer] Mailjet - properly format Cc and Bcc for API

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

Fix Cc and Bcc not being set properly
I will submit another PR with unit test before the end of next week

Commits
-------

e038605dca [Mailer] Mailjet - properly format Cc and Bcc for API
2020-08-20 15:32:51 +02:00
Thomas Calvet
cbd8ca0625 [HttpClient][ResponseTrait] Fix typo 2020-08-20 14:25:15 +02:00
Thibaut Cheymol
e038605dca [Mailer] Mailjet - properly format Cc and Bcc for API 2020-08-20 09:40:34 +02:00
Fabien Potencier
5a9180370e Fix CS 2020-08-20 07:29:43 +02:00
Fabien Potencier
dd190565dc bug #37890 [Notifier] Fixed base_uri while call auth/time API (leblanc-simon)
This PR was squashed before being merged into the 5.1 branch.

Discussion
----------

[Notifier] Fixed base_uri while call auth/time API

This patch fixed the base_uri missing while we call the auth/time OVH
API.

* Without this patch, the API call failed because the URL is wrong :
eu.api.ovh.com/auth/time

* With this patch, the API call successed, URL is :
https://eu.api.ovh.com/1.0/auth/time

| Q             | A
| ------------- | ---
| Branch?       | 5.1
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fixed base_uri while call auth/time API
| License       | MIT

Commits
-------

2f91485c40 [Notifier] Fixed base_uri while call auth/time API
2020-08-20 07:28:57 +02:00
Simon Leblanc
2f91485c40 [Notifier] Fixed base_uri while call auth/time API 2020-08-20 07:28:49 +02:00
Maxime Steinhausser
fc2133087d
Fixed PropertyInfo entry in UPGRADE-5.2 file 2020-08-19 19:29:39 +02:00
Fabien Potencier
3c270fbb1f bug #37888 [Mailer] Reorder headers used to determine Sender (cvmiert)
This PR was submitted for the master branch but it was merged into the 4.4 branch instead.

Discussion
----------

[Mailer] Reorder headers used to determine Sender

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

Use the `Return-Path` header as the last candidate to determine the Envelope's sender address.

The `Return-Path` is usually configured _in addition_ to the `Sender` and/or `From` header: it allows for email bounces and complaints to be sent to a dedicated email address. It should therefor not be used as the first candidate header to determine the sender.

Commits
-------

7e60a8f8c9 [Mailer] Reorder headers used to determine Sender
2020-08-19 19:15:16 +02:00
Fabien Potencier
d6980e5f38 feature #32133 [PropertyAccess] Allow to disable magic __get & __set (ogizanagi)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[PropertyAccess] Allow to disable magic __get & __set

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes   <!-- please add some, will be required by reviewers -->
| Fixed tickets | N/A   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | TODO

Working with some legacy code having annoying `__get` & `__set` methods, this would have been useful the same way `__call` can be enabled/disabled.

Commits
-------

11b7bf316e [PropertyAccess] Allow to disable magic __get & __set
2020-08-19 19:12:12 +02:00
Clara van Miert
7e60a8f8c9
[Mailer] Reorder headers used to determine Sender
Use the `Return-Path` header as the last candidate to determine the
Envelope's sender address.

The `Return-Path` is usually configured _in addition_ to the `Sender`
and/or `From` header: it allows for email bounces and complaints to be
sent to a dedicated email address. It should therefore not be used as
the first candidate header to determine the sender.
2020-08-19 19:05:08 +02:00
Maxime Steinhausser
6288449f61 [Validator] Remove duplicated require 2020-08-19 15:55:42 +02:00
Maxime Steinhausser
11b7bf316e [PropertyAccess] Allow to disable magic __get & __set 2020-08-19 15:25:50 +02:00
Fabien Potencier
7e24fc193a minor #37886 [Security] Fix tests (ogizanagi)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Security] Fix tests

| Q             | A
| ------------- | ---
| Branch?       | master <!-- 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 #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | N/A

Fixes https://travis-ci.org/github/symfony/symfony/jobs/719243848#L6234-L6242 (relates to #36925)

Commits
-------

e04386c187 [Security] Fix tests
2020-08-19 14:31:48 +02:00
Maxime Steinhausser
e04386c187 [Security] Fix tests 2020-08-19 14:13:04 +02:00
Fabien Potencier
e1917509e4 Merge branch '5.1'
* 5.1:
  [Lock] MongoDbStore handle duplicate querystring keys in mongodb uri when stripping
  [PropertyInfo] Fix ReflectionExtractor + minor tweaks
2020-08-19 13:09:46 +02:00
Fabien Potencier
679cc4dff1 bug #37857 [PropertyInfo] Fix ReflectionExtractor + minor tweaks (ogizanagi)
This PR was merged into the 5.1 branch.

Discussion
----------

[PropertyInfo] Fix ReflectionExtractor + minor tweaks

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

Spotted while rebasing #32133

Commits
-------

7ccb5a1cf2 [PropertyInfo] Fix ReflectionExtractor + minor tweaks
2020-08-19 13:09:12 +02:00
Fabien Potencier
c426abed85 bug #37868 [Lock] MongoDbStore handle duplicate querystring keys in mongodb uri when stripping (kralos)
This PR was squashed before being merged into the 5.1 branch.

Discussion
----------

[Lock] MongoDbStore handle duplicate querystring keys in mongodb uri when stripping

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

Allow duplicate querystring keys when stripping `collection`. `readPreferenceTags` is currently allowed to be specified twice so re-assembling the querystring with `http_build_query` will also strip duplicated `readPreferenceTags`. Use `preg_match` instead.

Commits
-------

c1ea9ae476 [Lock] MongoDbStore handle duplicate querystring keys in mongodb uri when stripping
2020-08-19 12:50:41 +02:00
Joe Bennett
c1ea9ae476 [Lock] MongoDbStore handle duplicate querystring keys in mongodb uri when stripping 2020-08-19 12:50:35 +02:00
Fabien Potencier
c48b1d3b99 minor #37881 [Validator] Add Lithuanian translation for ISIN constraint (norkunas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Add Lithuanian translation for ISIN constraint

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

Commits
-------

d652041647 [Validator] Add Lithuanian translation for ISIN constraint
2020-08-19 06:57:51 +02:00
Tomas
d652041647 [Validator] Add Lithuanian translation for ISIN constraint 2020-08-19 07:26:06 +03:00
Fabien Potencier
27d84dbe57 feature #36016 [Translation] Add a pseudo localization translator (fancyweb)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Translation] Add a pseudo localization translator

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

This PR introduces a new translator to be able to test apps with pseudo localization (check the related issue).

The `PseudoLocalizationTranslator` decorates another translator and then alter the translated string. There are 5 options:

- accents:
     - type: boolean
     - default: true
     - description: replace ASCII characters of the translated string with accented versions or similar characters
     - example: if true, `foo` => `ƒöö`

- expansion_factor:
     - type: float
     - default: 1
     - validation: it must be greater than or equal to 1
     - description: expand the translated string by the given factor with spaces and tildes
     example: if 2, `foo` => `~foo ~`

- brackets:
     - type: boolean
     - default: true
     - description: wrap the translated string with brackets
     - example: if true, `foo` => `[foo]`

- parse_html:
     - type: boolean
     - default: false
     - description: parse the translated string as HTML - looking for HTML tags has a performance impact but allows to preserve them from alterations - it also allows to compute the visible translated string length which is useful to correctly expand ot when it contains HTML
     - warning: unclosed tags are unsupported, they will be fixed (closed) by the parser - eg, `foo <div>bar` => `foo <div>bar</div>`

- localizable_html_attributes:
     - type: string[]
     - default: []
     - description: the list of HTML attributes whose values can be altered - it is only useful when the "parse_html" option is set to true
     - example: if ["title"], and with the "accents" option set to true, `<a href="#" title="Go to your profile">Profile</a>` => `<a href="#" title="Ĝö ţö ýöûŕ þŕöƒîļé">Þŕöƒîļé</a>` - if "title" was not in the "localizable_html_attributes" list, the title attribute data would be left unchanged.

Here is a screenshot on a Symfony demo page:
<img width="1374" alt="Screenshot 2020-03-26 at 14 31 20" src="https://user-images.githubusercontent.com/3658119/77652489-9380d100-6f6e-11ea-9bca-142faeee750b.png">

TODO:
- [x] Update FWB XSD

Commits
-------

4d6a41a415 [Translation] Add a pseudo localization translator
2020-08-18 16:11:58 +02:00
Fabien Potencier
6539a0fc2f feature #37755 Fix #37740: Cast all Request parameter values to string (rgeraads)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

Fix #37740: Cast all Request parameter values to string

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

This fix ensures that all parameter values in Browserkit\Request are received as strings on the receiving end.

Commits
-------

d4e2cec1fb Fix #37740: Cast all Request parameter values to string
2020-08-18 16:07:52 +02:00
Randy Geraads
d4e2cec1fb Fix #37740: Cast all Request parameter values to string 2020-08-18 16:07:45 +02:00
Fabien Potencier
da9672dccd minor #37878 🐛 [Mailer] Fix mailjet scheme bug (tcheymol)
This PR was merged into the 5.2-dev branch.

Discussion
----------

🐛 [Mailer] Fix mailjet scheme bug

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

Fix a typo introduced in mailjet-mailer accepted schemes that causes the scheme mailjet+api to not be recognized

Commits
-------

6f357a67cc 🐛 [Mailer] Fix mailjet scheme bug
2020-08-18 13:43:15 +02:00
Fabien Potencier
fbcdbf99a4 Merge branch '5.1'
* 5.1:
  fix: clarify parameter name to comply with deprecations from #34074
  [Sendgrid-Mailer] Fixed envelope recipients on sendgridApiTransport
  mark the AssertingContextualValidator class as internal
  Fix the parameter names in the SecurityFactoryInterface::create() method
  [Serializer][ClassDiscriminatorMapping] Fix getMappedObjectType() when a discriminator child extends another one
  make return type correct
2020-08-18 13:41:45 +02:00
Fabien Potencier
44caccbac8 Merge branch '4.4' into 5.1
* 4.4:
  [Sendgrid-Mailer] Fixed envelope recipients on sendgridApiTransport
  mark the AssertingContextualValidator class as internal
  Fix the parameter names in the SecurityFactoryInterface::create() method
  [Serializer][ClassDiscriminatorMapping] Fix getMappedObjectType() when a discriminator child extends another one
  make return type correct
2020-08-18 13:41:36 +02:00
Fabien Potencier
88bf7211a9 Merge branch '3.4' into 4.4
* 3.4:
  mark the AssertingContextualValidator class as internal
  make return type correct
2020-08-18 13:39:55 +02:00
Thibaut Cheymol
6f357a67cc 🐛 [Mailer] Fix mailjet scheme bug 2020-08-18 13:38:58 +02:00
Fabien Potencier
4bdb2227f6 minor #37877 fix: clarify parameter name to comply with deprecations from #34074 (Dennis Langen)
This PR was submitted for the master branch but it was squashed and merged into the 5.1 branch instead.

Discussion
----------

fix: clarify parameter name to comply with deprecations from #34074

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

[FrameworkBundle] Clarify parameter name from `$attributes` to `$attribute` in `AbstractController:denyUnlessGranted`

Commits
-------

91249ed0bf fix: clarify parameter name to comply with deprecations from #34074
2020-08-18 13:35:02 +02:00
Dennis Langen
91249ed0bf fix: clarify parameter name to comply with deprecations from #34074 2020-08-18 13:34:54 +02:00
Fabien Potencier
fcc75d9563 minor #37760 make return type correct (vladyslavstartsev)
This PR was merged into the 3.4 branch.

Discussion
----------

make return type correct

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

Since the real return type is `\ArrayIterator` AND array of `FormView` I've decided to change it. Also the other reason is that phpstan iks kind of failing because of this and I need to `assert` things in children of this class.

Commits
-------

32b5b9e1d7 make return type correct
2020-08-18 13:29:18 +02:00
Fabien Potencier
a2d360b869 Fix a test 2020-08-18 13:22:10 +02:00
Fabien Potencier
5cbb019902 bug #37872 [Sendgrid-Mailer] Fixed envelope recipients on sendgridApiTransport (arendjantetteroo)
This PR was merged into the 4.4 branch.

Discussion
----------

[Sendgrid-Mailer] Fixed envelope recipients on sendgridApiTransport

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

Fixes #37870

The SendgridApiTransport was not using the envelope to get the
recipients, so overriding the recipients with the EnvelopeListener was
not working.

Commits
-------

c4e5131757 [Sendgrid-Mailer] Fixed envelope recipients on sendgridApiTransport
2020-08-18 12:13:56 +02:00
Arend-Jan Tetteroo
c4e5131757 [Sendgrid-Mailer] Fixed envelope recipients on sendgridApiTransport
Fixes #37870

The SendgridApiTransport was not using the envelope to get the
recipients, so overriding the recipients with the EnvelopeListener was
not working.
2020-08-18 12:11:56 +02:00
Fabien Potencier
5d8879823b minor #37869 Fix the parameter names in the SecurityFactoryInterface::create() method (leofeyer)
This PR was merged into the 4.4 branch.

Discussion
----------

Fix the parameter names in the SecurityFactoryInterface::create() method

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

With regard to PHP 8, Psalm has added a named arguments check:
https://psalm.dev/articles/getting-ready-for-named-arguments

This check currently fails, because the `SecurityFactoryInterface` uses different parameter names than the `AbstractFactory`. You can see for yourselves at https://psalm.dev/r/81413a1c96.

Commits
-------

a73f5c1587 Fix the parameter names in the SecurityFactoryInterface::create() method
2020-08-18 12:08:43 +02:00
Fabien Potencier
c23166c8d8 Merge branch '5.1'
* 5.1:
  [Validator] fix tests
2020-08-18 12:04:11 +02:00
Fabien Potencier
56bf1bca49 minor #37838 [Validator] fix tests (xabbuh)
This PR was merged into the 5.1 branch.

Discussion
----------

[Validator] fix tests

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

Commits
-------

162771f7e3 [Validator] fix tests
2020-08-18 12:01:51 +02:00