Commit Graph

50058 Commits

Author SHA1 Message Date
Fabien Potencier
08ff65fcb5 bug #37611 [Mailer] Fix failover transport (fabpot)
This PR was merged into the 5.1 branch.

Discussion
----------

[Mailer] Fix failover transport

| 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 #37593 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | n/a

This fixes a regression in 5.1.

Commits
-------

8b673f5a81 [Mailer] Fix failover transport
2020-07-20 18:30:11 +02:00
Fabien Potencier
8b673f5a81 [Mailer] Fix failover transport 2020-07-20 16:15:11 +02:00
Fabien Potencier
3619661d65 bug #37594 Use hexadecimal numerals instead of hexadecimals in strings to repres… (arekzb)
This PR was submitted for the master branch but it was merged into the 4.4 branch instead.

Discussion
----------

Use hexadecimal numerals instead of hexadecimals in strings to repres…

Use hexadecimal numerals instead of hexadecimals in strings to represent error codes.

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #37577 , #36327
| License       | MIT

Class constants are now hexadecimal numerals instead of hexadecimals in strings.

Commits
-------

e9f7769111 Use hexadecimal numerals instead of hexadecimals in strings to represent error codes.
2020-07-20 09:00:45 +02:00
Arek Bochinski
e9f7769111 Use hexadecimal numerals instead of hexadecimals in strings to represent error codes. 2020-07-20 09:00:36 +02:00
Thomas Calvet
b352ff08ad [SCA] Minor fixes on tests 2020-07-16 11:41:49 +02:00
Fabien Potencier
63d886f7cb bug #37576 [WebProfilerBundle] modified url generation to use absolute urls (smatyas)
This PR was merged into the 4.4 branch.

Discussion
----------

[WebProfilerBundle] modified url generation to use absolute urls

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

## TODO
- [x] gather feedback for my changes

## Use case

The web debug toolbar ajax calls are broken in the case when you have to work with a page template that uses HTML `<base>` Tag for whatever reason.

In this case, the ajax calls of the debug toolbar will target that base url, as these urls are rendered as relative urls in the injected toolbar HTML content.

A simple solution for this issue is to generate absolute urls for these calls - this is my first approach in this PR.

A more complex solution would be a configurable behavior with the current method as the default.

I believe though that the simple solution is enough here, as it will result in the same requests for developers using templates without any `<base>` tag, and it will also make the dev toolbar usable for my case (using a `<base>` tag).

(Please let me know if I should make this PR against another branch.)

Commits
-------

3f3976bd94 [WebProfilerBundle] modified url generation to use absolute urls
2020-07-15 14:59:24 +02:00
Fabien Potencier
367aa1df6c minor #37431 [HttpKernel] hide "_password" in request data collector raw content (EfeloPHP)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[HttpKernel] hide "_password" in request data collector raw content

The password was already hidden in POST parameters, but still remained visible in raw content.

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

This is my first contribution, so I hope I did everything right :)

Commits
-------

715c793070 [HttpKernel] added password hiding in request data collector raw content
2020-07-15 14:56:50 +02:00
efelo
715c793070 [HttpKernel] added password hiding in request data collector raw content
The password was already hidden in POST parameters, but still remained visible in raw content

[HttpKernel] added password hiding in request data collector raw content

The password was already hidden in POST parameters, but still remained visible in raw content

[HttpKernel] added password hiding in request data collector raw content

The password was already hidden in POST parameters, but still remained visible in raw content
2020-07-15 14:56:16 +02:00
Fabien Potencier
488e2c9fa9 feature #37567 [PhpUnitBridge] Polyfill new phpunit 9.1 assertions (phpfour)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[PhpUnitBridge] Polyfill new phpunit 9.1 assertions

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #37320
| License       | MIT
| Doc PR        | n/a

This PR adds the following new assertions that was added to PhpUnit 9.1:

- Implement **`assertIsNotReadable()`** as alternative for `assertNotIsReadable()`
- Implement **`assertIsNotWritable()`** as alternative for `assertNotIsWritable()`
- Implement **`assertDirectoryDoesNotExist()`** as alternative for `assertDirectoryNotExists()`
- Implement **`assertDirectoryIsNotReadable()`** as alternative for `assertDirectoryNotIsReadable()`
- Implement **`assertDirectoryIsNotWritable()`** as alternative for `assertDirectoryNotIsWritable()`
- Implement **`assertFileDoesNotExist()`** as alternative for `assertFileNotExists()`
- Implement **`assertFileIsNotReadable()`** as alternative for `assertFileNotIsReadable()`
- Implement **`assertFileIsNotWritable()`** as alternative for `assertFileNotIsWritable()`
- Implement **`assertMatchesRegularExpression()`** as alternative for `assertRegExp()`
- Implement **`assertDoesNotMatchRegularExpression()`** as alternative for `assertNotRegExp()`

Commits
-------

51c0bf0d0d [PhpUnitBridge] Polyfill new phpunit 9.1 assertions
2020-07-15 14:47:42 +02:00
Mohammad Emran Hasan
51c0bf0d0d [PhpUnitBridge] Polyfill new phpunit 9.1 assertions 2020-07-15 14:47:34 +02:00
Matyas Somfai
3f3976bd94 [WebProfilerBundle] modified url generation to use absolute urls 2020-07-15 14:32:58 +02:00
Fabien Potencier
8308861b70 bug #36888 [Mailer] Fix mandrill raw http request setting from email/name (JohJohan)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Fix mandrill raw http request setting from email/name

| Q             | A
| ------------- | ---
| Branch?       | 4.4, 5.0, 5.1
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36879
| License       | MIT
| Doc PR        | None

As describe in https://github.com/symfony/symfony/issues/36879 there is a bug in sending raw http request to mandrill it will not set from email/name correct.

As you can see i make sure to set `from_email` and `from_name` correct now and changed the unit test to check correct you can see the doc that the format is correct https://mandrillapp.com/api/docs/messages.curl.html#method-send-raw

Commits
-------

6128dd0b75 ticket_36879 - Fix mandrill raw http request setting from email/name
2020-07-15 14:27:58 +02:00
Fabien Potencier
a4550dac6a feature #37479 [HttpFoundation] Added File::getContent() (lyrixx)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[HttpFoundation] Added File::getContent()

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

---

This is a very simple PR but I think it increases the DX when working
with uploaded files: I looked at for this method and I did not found it.
So I had to check witch method returns the "pathname" or to remember I
can cast the object to string to get its pathname.

It's a small detail, but IMHO it's better with it.

About file_get_contents vs stream: let's be simple here. If one want a
stream, they can use the code they always used for it :)

Commits
-------

50d5167a66 [HttpFoundation] Added File::getContent()
2020-07-15 14:24:15 +02:00
Fabien Potencier
fd13f5f8e9 bug #37527 [Mailer] Fix reply-to functionality in the SendgridApiTransport (jt2k)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Mailer] Fix reply-to functionality in the SendgridApiTransport

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

When sending a message using the `SendgridApiTransport`, the reply-to address was being ignored. In other transports, the reply to can be set using headers, but SendGrid requires that certain fields be added explicitly to the API payload. This is already handled for From, To, Cc, Bcc, and Subject, but was not handled for Reply-To. This change extracts the reply to address from the `Email` object and adds it to the payload.

Note that the `Email` object allows for multiple Reply-To addresses, but SendGrid only supports a single one, so I am just using the first element of the array.

I also fixed a link in a comment to SendGrid's documentation explaining the reserved headers that are not allowed.

Commits
-------

2cf25d1055 [Mailer] Fix reply-to functionality in the SendgridApiTransport
2020-07-15 14:22:44 +02:00
Jason Tan
2cf25d1055 [Mailer] Fix reply-to functionality in the SendgridApiTransport 2020-07-15 14:22:36 +02:00
Fabien Potencier
f617380af5 bug #37581 [Mime] Fix compat with HTTP requests (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mime] Fix compat with HTTP requests

| Q             | A
| ------------- | ---
| Branch?       | 4.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 #37500, Fix #36738, Fix #35443
| License       | MIT
| Doc PR        | n/a

Commits
-------

52e7d7cf17 [Mime] Fix compat with HTTP requests
2020-07-15 14:00:31 +02:00
Fabien Potencier
502d6fba75 Merge branch '5.1'
* 5.1:
  [DependencyInjection][Config] Use several placeholder unique prefixes for dynamic placeholder values
  [Mime] Keep Sender full address when used by non-SMTP transports
  Update MimeTypes.php
2020-07-15 12:59:44 +02:00
Fabien Potencier
28e072a8ec Merge branch '5.0' into 5.1
* 5.0:
  [DependencyInjection][Config] Use several placeholder unique prefixes for dynamic placeholder values
  [Mime] Keep Sender full address when used by non-SMTP transports
  Update MimeTypes.php
2020-07-15 12:53:22 +02:00
Fabien Potencier
ba1b05e1b6 Merge branch '4.4' into 5.0
* 4.4:
  [DependencyInjection][Config] Use several placeholder unique prefixes for dynamic placeholder values
  [Mime] Keep Sender full address when used by non-SMTP transports
  Update MimeTypes.php
2020-07-15 12:53:08 +02:00
Fabien Potencier
b34abaff98 bug #37580 [Mime] Keep Sender full address when used by non-SMTP transports (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mime] Keep Sender full address when used by non-SMTP transports

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

refs #36178

The `Envelope` is an SMTP concept. The Sender is used in the `MAIL FROM` SMTP command, where only an address is supported. But we are also supporting non-SMTP transports, where the Sender might also be used as the `From` header, where a full mailbox is supported.

To take into account the 2 usages, this PR keeps the full mailbox in the Envelope and let the SMTP class only use the address (which was already the case anyway).

Commits
-------

1ca9be77aa [Mime] Keep Sender full address when used by non-SMTP transports
2020-07-15 12:52:19 +02:00
Fabien Potencier
52e7d7cf17 [Mime] Fix compat with HTTP requests 2020-07-15 12:07:33 +02:00
Nicolas Grekas
a3bd36c8e7 bug #37511 [DependencyInjection][Config] Use several placeholder unique prefixes for dynamic placeholder values (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection][Config] Use several placeholder unique prefixes for dynamic placeholder values

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

Currently, in Config BaseNode, we are only able to check on one dynamic placeholder unique prefix (ie one env placeholder unique prefix in our usage) to ignore the validation of config values that contain placeholder values. It isn't enough in some scenarios, we would need to be able to check on multiple prefixes.

In MergeExtensionConfigurationPass we need to not validate config values that are placeholders (they are checked later by a dedicated pass), so we set the BaseNode placeholder unique prefix for each processed extension. Because the env placeholder unique prefix depends of the bag data, if a first extension creates the env placeholder and adds a parameter to the bag, the second extension reusing the same env placeholder will generate a different env placeholder unique prefix. Therefore the validation of the value will not be skipped because the env placeholder contains the first env placeholder unique prefix while the BaseNode placeholder unique prefix is set with the second.

Another solution might be to mutate the existing env placeholders to use the new unique prefix when merging the env placeholders ? I guess it depends on which side we want to fix this (DI or Config).

cc @ro0NL

Commits
-------

3d754ad688 [DependencyInjection][Config] Use several placeholder unique prefixes for dynamic placeholder values
2020-07-15 10:50:46 +02:00
Nicolas Grekas
5a61446c3c minor #37422 [Mime] switching source of mime types from Apache to "MIME-db" (Daniel González)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[Mime] switching source of mime types from Apache to "MIME-db"

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

Commits
-------

ebea452f57 [Mime] switching source of mime types from Apache to "MIME-db"
2020-07-15 10:28:50 +02:00
Daniel González
ebea452f57 [Mime] switching source of mime types from Apache to "MIME-db" 2020-07-15 10:28:42 +02:00
Thomas Calvet
3d754ad688 [DependencyInjection][Config] Use several placeholder unique prefixes for dynamic placeholder values 2020-07-15 10:27:46 +02:00
Fabien Potencier
1ca9be77aa [Mime] Keep Sender full address when used by non-SMTP transports 2020-07-15 08:28:59 +02:00
Fabien Potencier
05fe56b88e minor #37571 Update MimeTypes.php (jersoe)
This PR was submitted for the master branch but it was merged into the 4.4 branch instead.

Discussion
----------

Update MimeTypes.php

Typo in exception message on line 140.

| Q             | A
| ------------- | ---
| Branch?       | master for features / 3.4, 4.4, 5.0 or 5.1 for bug fixes <!-- see below -->
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
Simple typo, "have you enabled" vs "have you enable".

Commits
-------

f6b71cfa97 Update MimeTypes.php
2020-07-14 10:23:22 +02:00
jersoe
f6b71cfa97 Update MimeTypes.php
Typo in exception message on line 140.
2020-07-14 10:23:12 +02:00
HypeMC
d10e43d085 Allow same middleware to be used multiple times with different arguments 2020-07-13 20:19:17 +02:00
Nicolas Grekas
ba4d57bb5f Merge branch '5.1'
* 5.1:
  [Cache] fix merge
2020-07-13 11:17:24 +02:00
Nicolas Grekas
85da081614 [Cache] fix merge 2020-07-13 11:17:19 +02:00
Nicolas Grekas
d8338dc358 minor #36799 Remove some magic from TypeValidator logic and OptionsResolver type verify logic (drealecs)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

Remove some magic from TypeValidator logic and OptionsResolver type verify logic

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

Following discussion on https://twitter.com/Ocramius/status/1260236117129015297
The changes in this PR could ensure that types that can be verified by the TypeValidator is limited and there is no way to magically use it.
For example you can break it by defining you own function like:
```php
function is_usercollection {
    return true;
}
```
that will validate any value that have the validator type as 'UserCollection'.

Another example would be defining `is_lower` or `ctype_int` that would also break the implementation.

Commits
-------

e8c9049a5a Remove some magic from TypeValidator logic and OptionsResolver type verify logic
2020-07-13 11:15:52 +02:00
Alexandru Patranescu
e8c9049a5a Remove some magic from TypeValidator logic and OptionsResolver type verify logic 2020-07-13 11:15:37 +02:00
Nicolas Grekas
ef19a03b2b Merge branch '5.1'
* 5.1:
  [Cache] Use the default expiry when saving (not when creating) items
  Fix typo
  Fix DBAL deprecation
  [Form] Fix ChoiceType translation domain
  Add Tagalog translations for new form messages
  [Form] Add missing vietnamese translations
  sync translations from master
  [OptionsResolver] Fix force prepend normalizer
  add vietnamese translation for html5 color validation
2020-07-12 14:58:15 +02:00
Nicolas Grekas
c87847c361 Merge branch '5.0' into 5.1
* 5.0:
  [Cache] Use the default expiry when saving (not when creating) items
  Fix typo
  Fix DBAL deprecation
  [Form] Fix ChoiceType translation domain
  Add Tagalog translations for new form messages
  [Form] Add missing vietnamese translations
  sync translations from master
  [OptionsResolver] Fix force prepend normalizer
  add vietnamese translation for html5 color validation
2020-07-12 14:58:00 +02:00
Nicolas Grekas
afd9760357 Merge branch '4.4' into 5.0
* 4.4:
  [Cache] Use the default expiry when saving (not when creating) items
  Fix typo
  Fix DBAL deprecation
  [Form] Fix ChoiceType translation domain
  Add Tagalog translations for new form messages
  [Form] Add missing vietnamese translations
  sync translations from master
  [OptionsResolver] Fix force prepend normalizer
  add vietnamese translation for html5 color validation
2020-07-12 14:51:51 +02:00
Nicolas Grekas
701161eb40 Merge branch '3.4' into 4.4
* 3.4:
  [Cache] Use the default expiry when saving (not when creating) items
2020-07-12 14:49:36 +02:00
Nicolas Grekas
a397c490b0 bug #37562 [Cache] Use the default expiry when saving (not when creating) items (philipp-kolesnikov)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] Use the default expiry when saving (not when creating) items

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

This PR is for align expiration handling in ChainAdapter with ChainCache as proposed in #37263.

Commits
-------

49e9f3229c [Cache] Use the default expiry when saving (not when creating) items
2020-07-12 14:39:01 +02:00
Philipp Kolesnikov
49e9f3229c [Cache] Use the default expiry when saving (not when creating) items 2020-07-12 14:37:39 +02:00
Nicolas Grekas
0db52e106d Merge branch '3.4' into 4.4
* 3.4:
  Fix typo
2020-07-12 13:20:48 +02:00
Nicolas Grekas
adc79e3035 Fix typo 2020-07-12 13:20:43 +02:00
Nicolas Grekas
c4e47fdd65 Merge branch '3.4' into 4.4
* 3.4:
  Fix DBAL deprecation
  [Form] Fix ChoiceType translation domain
  Add Tagalog translations for new form messages
  [Form] Add missing vietnamese translations
  sync translations from master
  add vietnamese translation for html5 color validation
2020-07-12 12:34:29 +02:00
Nicolas Grekas
3ae61ec22c bug #37563 Fix DBAL deprecation (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

Fix DBAL deprecation

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

Follows https://github.com/doctrine/dbal/pull/4163

Commits
-------

4273aedfae Fix DBAL deprecation
2020-07-12 12:25:53 +02:00
Nicolas Grekas
4273aedfae Fix DBAL deprecation 2020-07-12 12:21:23 +02:00
Nicolas Grekas
a56f6482a5 bug #37521 [Form] Fix ChoiceType translation domain (VincentLanglet)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Form] Fix ChoiceType translation domain

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

When using
```
->add('foo', ChoiceType::class, [
    'label'       => 'label',
    'translation_domain' => false,
    'choices'     => [
        'choice.no'  => false,
        'choice.yes' => true,
    ],
    'choice_translation_domain' => 'messages',
    'expanded'    => true,
    'required'    => false,
    'placeholder' => false,
]);
```

I discovered that the choices was not translated.

Seems like it's because the subForm is using the `translation_domain` instead of the `choice_translation_domain`.

Commits
-------

2effda79ea [Form] Fix ChoiceType translation domain
2020-07-12 11:52:47 +02:00
Vincent Langlet
2effda79ea [Form] Fix ChoiceType translation domain 2020-07-12 11:52:40 +02:00
Nicolas Grekas
a10ff4cb00 bug #37550 [OptionsResolver] Fix force prepend normalizer (hason)
This PR was merged into the 4.4 branch.

Discussion
----------

[OptionsResolver] Fix force prepend normalizer

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

Commits
-------

6eb836b6f9 [OptionsResolver] Fix force prepend normalizer
2020-07-12 11:44:05 +02:00
Nicolas Grekas
ae91683ba4 minor #37552 [Form] sync translations from master (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] sync translations from master

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

Commits
-------

acea9be6d3 sync translations from master
2020-07-12 11:42:44 +02:00
Nicolas Grekas
d705b21def minor #37555 Add Tagalog translations for new form messages (ocrampete16)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

Add Tagalog translations for new form messages

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| 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        |

This PR adds Tagalog translations for the new form messages @xabbuh added in https://github.com/symfony/symfony/pull/37552.

~~As I'm not aware of any Filipinos that regularly review Symfony pull requests, I'm going to ask my mother to proof-read this first before I remove the "WIP" label from the title. :)~~

Commits
-------

1809b7c5eb Add Tagalog translations for new form messages
2020-07-12 11:42:01 +02:00
Marco Petersen
1809b7c5eb Add Tagalog translations for new form messages 2020-07-12 11:41:55 +02:00