Commit Graph

44002 Commits

Author SHA1 Message Date
Nicolas Grekas
9475b2e82d bug #33275 [Intl] make polyfill classes abstract, fix edge case (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Intl] make polyfill classes abstract, fix edge case

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

While working on return types, I keep stumbling on those classes that are `@internal`, but for which we must not add return types, because they're polyfills and are extended by stubs found in the `Resources` folder of the component.

Making the polyfills abstract fixes the linting issue.
This made me discover we have a glitch in the `getPattern()` implementation, that makes our version diverge from intl's. Fixed here too.

On 4.4 because let's not disrupt 3.4.

Commits
-------

c757b95aed [Intl] make polyfill classes abstract, fix edge case
2019-08-21 12:59:41 +02:00
Fabien Potencier
7046cac7f6 feature #33272 [Translation] deprecate support for null locales (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Translation] deprecate support for null locales

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

Commits
-------

e6b6a9d33a deprecate support for null locales
2019-08-21 12:12:17 +02:00
Nicolas Grekas
c757b95aed [Intl] make polyfill classes abstract, fix edge case 2019-08-21 12:11:32 +02:00
Fabien Potencier
7aedfe7079 Merge branch '4.3' into 4.4
* 4.3:
  [Mime] Trim and remove line breaks from NamedAddress name arg
2019-08-21 10:50:18 +02:00
Fabien Potencier
58439e3166 bug #33216 [Mime] Trim and remove line breaks from NamedAddress name arg (maldoinc)
This PR was squashed before being merged into the 4.3 branch (closes #33216).

Discussion
----------

[Mime] Trim and remove line breaks from NamedAddress name arg

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | YES
| New feature?  | NO
| 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 | N/A   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

This patch trims the name argument of named address in order to avoid some cases where the name is a non-empty input consisting of whitespace and line breaks which would lead to forming of addresses such as `" " <mail@example.org>` <sup>1</sup>

---

In a large Symfony codebase that deals with sending large volumes of email we encountered an issue after the Mailer was changed from PHPMailer to the Symfony Mailer component.

The issue: Some emails would not render correctly as either plaintext or html but instead the original email source with headers and quoted-printable content would render in clients such as MS Outlook 2003, later versions of Outlook and other clients do not seem affected.

After some investigation we found that the error came from a line that looked like this: `$message->addTo(new NamedAddress($contact->getEmailCanonical(), $contact->getFullName()))`.

The `getFullName` method simply concated the first/last name with a space in between. For contacts without either, this resulted in representation 1. This causes MS Outlook 2003 (potentially Outlook 2000 as well but this was not tested) to malfunction and completely fail to render the email.

This patch aims to fix the aforementioned issue.

Commits
-------

e491e3a594 [Mime] Trim and remove line breaks from NamedAddress name arg
2019-08-21 10:46:47 +02:00
Emirald Mateli
e491e3a594 [Mime] Trim and remove line breaks from NamedAddress name arg 2019-08-21 10:46:37 +02:00
Fabien Potencier
451daa0b06 feature #33269 [TwigBridge] Mark all classes extending twig as @final (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[TwigBridge] Mark all classes extending twig as @final

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes-ish
| 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 | refs #33039
| License       | MIT
| Doc PR        | n/a

Classes defining extensions/nodes/node visitors/token parsers should not be changed. They should be final.

That would also help with Twig 3.0 which introduces type hints (including return types).

Commits
-------

d657459a5f [TwigBridge] Mark all classes extending twig as @final
2019-08-21 10:34:41 +02:00
Fabien Potencier
b36961c36a feature #33270 [Mime] Remove NamedAddress (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mime] Remove NamedAddress

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | yes     <!-- 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 | n/a
| License       | MIT
| Doc PR        | n/a

While working on #33091, we realize that having both `NamedAddress` and `Address` brings some unneeded complexity. Initially, I added both as some headers do not support `NamedAddress`es. But the code already does the right thing by "downgrading" them to `Address` instances. So, let's simplify our internal code and make life easier for our users too.

Commits
-------

eb7d74e6c5 [Mime] Remove NamedAddress
2019-08-21 10:32:13 +02:00
Christian Flothmann
e6b6a9d33a deprecate support for null locales 2019-08-21 10:16:47 +02:00
Fabien Potencier
d657459a5f [TwigBridge] Mark all classes extending twig as @final 2019-08-21 09:28:19 +02:00
Fabien Potencier
eb7d74e6c5 [Mime] Remove NamedAddress 2019-08-21 09:13:01 +02:00
Fabien Potencier
5a753b1428 minor #33245 [Messenger] remove patch release BC layer of durable and expiring delay (Tobion)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] remove patch release BC layer of durable and expiring delay

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| 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 |
| License       | MIT
| Doc PR        |

Removes the small BC layer of #33127 from 4.3 in 4.4

Commits
-------

d5aaf44529 [Messenger] remove patch release BC layer of durable and expiring delay
2019-08-21 07:11:00 +02:00
Tobias Schultze
aa82566f76 [HttpKernel] deprecate global dir to load resources from 2019-08-21 00:57:10 +02:00
Nicolas Grekas
22319a9935 minor #33264 [4.4] Add return types on internal|final|private methods (bis) (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[4.4] Add return types on internal|final|private methods (bis)

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

Found while working on #33259

`: self` is used for final methods only. I'd have preferred using `: object` but that's not possible on PHP 7.1

Commits
-------

23faee406f [4.4] Add return types on internal|final|private methods (bis)
2019-08-20 23:39:47 +02:00
Nicolas Grekas
23faee406f [4.4] Add return types on internal|final|private methods (bis) 2019-08-20 23:22:06 +02:00
Nicolas Grekas
7eb5feec51 minor #33261 Add types to routing and DI configuration traits. (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

Add types to routing and DI configuration traits.

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | I don't think so.
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #32179, #33228
| License       | MIT
| Doc PR        | N/A

This PR backports the type declarations added to the configurator traits of the Routing and DI components. These traits expose only final methods, so it should be pretty safe to add return types to them.

The only scenario I could make up where this change will break something is if a trait is used to override a method: https://3v4l.org/EAsk8 But I doubt that those traits are used that way.

On master, we've used the `object` return type for the fluent methods. That type is not available on 4.4 where we have to support php 7.1. I'm using `self` instead. Since the methods are final and thus cannot be overridden, I believe that we shouldn't run into covariance issues here, so `self` should be safe.

Commits
-------

1ca30c97e6 Add types to roting and DI configuration traits.
2019-08-20 23:07:54 +02:00
Nicolas Grekas
543e4013d0 bug #33263 [Ldap] Add missing LdapUser::setPassword() (chalasr)
This PR was merged into the 4.4 branch.

Discussion
----------

[Ldap] Add missing LdapUser::setPassword()

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

Required for password migrations.

Commits
-------

08dd4f3ae1 [Ldap] Add missing LdapUser::setPassword()
2019-08-20 23:06:27 +02:00
Nicolas Grekas
af6cf3140d Merge branch '4.3' into 4.4
* 4.3:
  More docblock fixes
  fix test
2019-08-20 23:03:47 +02:00
Nicolas Grekas
7a0787c8bd Merge branch '3.4' into 4.3
* 3.4:
  More docblock fixes
2019-08-20 23:02:25 +02:00
Nicolas Grekas
50a3d64729 minor #33262 More docblock fixes (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

More docblock fixes

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

Found while working on #33259

Commits
-------

9b78d53d0d More docblock fixes
2019-08-20 23:00:23 +02:00
Robin Chalas
08dd4f3ae1 [Ldap] Add missing LdapUser::setPassword() 2019-08-20 22:58:33 +02:00
Nicolas Grekas
9b78d53d0d More docblock fixes 2019-08-20 22:53:36 +02:00
Alexander M. Turek
1ca30c97e6 Add types to roting and DI configuration traits. 2019-08-20 21:45:11 +02:00
Fabien Potencier
b7954640e3 bug #33260 [ErrorHandler] Registering basic exception handler to handle early failures (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] Registering basic exception handler to handle early failures

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

This behavior was previously handled by the removed `ExceptionHandler` class in https://github.com/symfony/symfony/pull/32637.

As this method is mainly called during Kernel boot, where nothing is yet available, the Response content is always HTML. Otherwise, If all goes well on booting, this exception handler will be replaced in `DebugHandlersListener` class:
8073b8abfb/src/Symfony/Component/HttpKernel/EventListener/DebugHandlersListener.php (L139)

where the advanced exception handler mechanism is activated.

Commits
-------

a2077a2369 Registers basic exception handler to handle early failures
2019-08-20 21:09:10 +02:00
Yonel Ceruto
a2077a2369 Registers basic exception handler to handle early failures 2019-08-20 14:56:58 -04:00
Nicolas Grekas
8073b8abfb some backports from master 2019-08-20 18:35:28 +02:00
Nicolas Grekas
31b668b8c4 minor #33255 Add return types to internal|final|private methods (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

Add return types to internal|final|private methods

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

Related to #33228
This adds return-type declarations to internal, final and private methods.
Found by using a patched DebugClassLoader + manual edits.

Commits
-------

32116184d7 Add return types to internal|final|private methods
2019-08-20 17:40:49 +02:00
Nicolas Grekas
32116184d7 Add return types to internal|final|private methods 2019-08-20 17:32:53 +02:00
Nicolas Grekas
4bffa04271 fix test 2019-08-20 16:56:01 +02:00
Nicolas Grekas
b253f25933 feature #33169 [HttpFoundation] Precalculate session expiry timestamp (azjezz)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation] Precalculate session expiry timestamp

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #13955, #21423, #14625
| License       | MIT

Continued work from the original PR #21423 / #21857

Commits
-------

066000afa2 [HttpFoundation] Precalculate session expiry timestamp
2019-08-20 16:51:07 +02:00
Nicolas Grekas
225bf41e3b Merge branch '4.3' into 4.4
* 4.3:
  cs fix
  Fix inconsistent return points.
  [Config] Add handling for ignored keys in ArrayNode::mergeValues.
  Fix inconsistent return points.
  [Security/Core] UserInterface::getPassword() can return null
  [Router] Fix TraceableUrlMatcher behaviour with trailing slash
  Revert "bug #33092 [DependencyInjection] Improve an exception message (fabpot)"
2019-08-20 16:44:19 +02:00
Nicolas Grekas
5ec6ff378b cs fix 2019-08-20 16:41:44 +02:00
Nicolas Grekas
cfb218456c minor #33254 Fix inconsistent return points (derrabus)
This PR was merged into the 4.3 branch.

Discussion
----------

Fix inconsistent return points

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #17201 in preparation for #33228
| License       | MIT
| Doc PR        | N/A

That's #33252 on the 4.3 branch.

Commits
-------

c26c53596e Fix inconsistent return points.
2019-08-20 16:28:49 +02:00
Alexander M. Turek
c26c53596e Fix inconsistent return points. 2019-08-20 16:27:59 +02:00
Nicolas Grekas
c1e0c1b05f minor #33108 Revert "bug #33092 [DependencyInjection] Improve an exception message" (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

Revert "bug #33092 [DependencyInjection] Improve an exception message"

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

As reminded by @ro0NL in https://github.com/symfony/symfony/pull/33092#issuecomment-520138148, it looks like we forgot that `CheckDefinitionValidityPass` already checks and suggests for leading slashes.

Why didn't you get the exception from `CheckDefinitionValidityPass` @fabpot?

Commits
-------

ed590ca16b Revert "bug #33092 [DependencyInjection] Improve an exception message (fabpot)"
2019-08-20 16:12:03 +02:00
Nicolas Grekas
c3ccd2aee5 bug #33124 [Config] Add handling for ignored keys in ArrayNode::mergeValues. (Alexandre Parent)
This PR was squashed before being merged into the 4.3 branch (closes #33124).

Discussion
----------

[Config] Add handling for ignored keys in ArrayNode::mergeValues.

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

Fix case where normalized data accepting and keeping ignored keys is rejected during merge.

Commits
-------

311e1c4e9e [Config] Add handling for ignored keys in ArrayNode::mergeValues.
2019-08-20 16:11:21 +02:00
Alexandre Parent
311e1c4e9e [Config] Add handling for ignored keys in ArrayNode::mergeValues. 2019-08-20 16:11:15 +02:00
Nicolas Grekas
aefbc93a07 Merge branch '3.4' into 4.3
* 3.4:
  Fix inconsistent return points.
  [Security/Core] UserInterface::getPassword() can return null
  [Router] Fix TraceableUrlMatcher behaviour with trailing slash
2019-08-20 16:07:54 +02:00
Nicolas Grekas
9672f4c98f bug #33244 [Router] Fix TraceableUrlMatcher behaviour with trailing slash (Xavier Leune)
This PR was merged into the 3.4 branch.

Discussion
----------

[Router] Fix TraceableUrlMatcher behaviour with trailing slash

| Q             | A
| ------------- | ---
| Branch?       | 3.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 | #32149
| License       | MIT
| Doc PR        | ¤
<!--
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.
-->
This pull requests fixes the bug #32149. This issue was about TraceableUrlMatcher having a wrong behaviour regarding trailing slashes (according to UrlMatcher and documentation).

With this pull requests, the test class TraceableUrlMatcherTest now extends UrlMatcherTest, to prevent such behaviour digression.

Thanks @nicolas-grekas for his feedback on the issue #32149

Commits
-------

fd1cb443fd [Router] Fix TraceableUrlMatcher behaviour with trailing slash
2019-08-20 15:36:35 +02:00
Nicolas Grekas
727d431bf2 minor #33257 [Security/Core] UserInterface::getPassword() can return null (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security/Core] UserInterface::getPassword() can return null

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

Our very own `User` class can return null already.

Commits
-------

00d7f8cde7 [Security/Core] UserInterface::getPassword() can return null
2019-08-20 15:35:21 +02:00
Nicolas Grekas
8069b58299 minor #33252 Fix inconsistent return points (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

Fix inconsistent return points

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #17201 in preparation for #33228
| License       | MIT
| Doc PR        | N/A

Inconsistent return points in methods prevent adding return types. I thought, I'll give it a try and fix them. After this PR, PhpStorm's inspection still finds 39 issues, but as far as I can tell, they're either false positives or fixture code.

Commits
-------

f5b6ee9de1 Fix inconsistent return points.
2019-08-20 15:34:30 +02:00
Alexander M. Turek
f5b6ee9de1 Fix inconsistent return points. 2019-08-20 15:31:17 +02:00
Nicolas Grekas
00d7f8cde7 [Security/Core] UserInterface::getPassword() can return null 2019-08-20 15:10:28 +02:00
Nicolas Grekas
a2ef397ea3 Merge branch '4.3' into 4.4
* 4.3:
  cs fix
  cs fix
  [HttpKernel] Remove outdated docblock comment
  Fix handling for session parameters
2019-08-20 14:49:24 +02:00
Nicolas Grekas
2c1f349602 Merge branch '3.4' into 4.3
* 3.4:
  cs fix
  [HttpKernel] Remove outdated docblock comment
2019-08-20 14:49:02 +02:00
Nicolas Grekas
55a484dc20 cs fix 2019-08-20 14:35:37 +02:00
Nicolas Grekas
974b77e781 cs fix 2019-08-20 13:59:54 +02:00
Nicolas Grekas
e132c429c0 bug #33253 Fix missing exporter in PHPUnit constraint poylfill (alcaeus)
This PR was merged into the 4.4 branch.

Discussion
----------

Fix missing exporter in PHPUnit constraint poylfill

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | -

Since PHPUnit 7 drops the constructor in `PHPUnit\Framework\Constraint\Constraint`, overriding the constructor in a user land constraint breaks. To do so, we create an exporter in `exporter()` as is done in PHPUnit > 7.

Commits
-------

b78c5cb1a6 Fix missing exporter in PHPUnit constraint poylfill
2019-08-20 12:04:03 +02:00
Andreas Braun
b78c5cb1a6
Fix missing exporter in PHPUnit constraint poylfill 2019-08-20 12:03:00 +02:00
Karoly Gossler
0e7bf6fb52 added Process::getLastOutputTime() method 2019-08-20 11:16:47 +02:00