Commit Graph

47040 Commits

Author SHA1 Message Date
Nathan Dench
967bc4a860 [WebProfiler] Remove 'none' when appending CSP tokens 2020-05-12 17:24:37 +10:00
Fabien Potencier
a8cb3cd2da bug #36743 [Yaml] Fix escaped quotes in quoted multi-line string (ossinkine)
This PR was merged into the 3.4 branch.

Discussion
----------

[Yaml] Fix escaped quotes in quoted multi-line string

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

This PR continues https://github.com/symfony/symfony/pull/19304

This PR fixes incorrect parsing quoted multi-line string which contain escaped quotes, see tests

Commits
-------

2e99caacaf [Yaml] Fix escaped quotes in quoted multi-line string
2020-05-11 09:51:54 +02:00
Fabien Potencier
6541ac2d03 bug #36777 [TwigBundle] FormExtension does not have a constructor anymore since sf 4.0 (Tobion)
This PR was merged into the 4.4 branch.

Discussion
----------

[TwigBundle] FormExtension does not have a constructor anymore since sf 4.0

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       |
| License       | MIT
| Doc PR        |

Commits
-------

35e391aaa2 [TwigBundle] FormExtension does not have a constructor anymore since sf 4.0
2020-05-10 18:07:44 +02:00
Tobias Schultze
35e391aaa2 [TwigBundle] FormExtension does not have a constructor anymore since sf 4.0 2020-05-10 16:50:02 +02:00
Nicolas Grekas
333f7187dc [HttpClient] fix testTimeoutIsNotAFatalError (bis) 2020-05-09 19:43:44 +02:00
Nicolas Grekas
00ae470307 [HttpClient] fix testTimeoutIsNotAFatalError 2020-05-09 18:24:06 +02:00
Nicolas Grekas
4ab6ff37bd [HttpClient] improve testTimeoutIsNotAFatalError 2020-05-09 17:57:30 +02:00
Fabien Potencier
6310084f25 bug #36716 [Mime] handle passing custom mime types as string (mcneely)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mime] handle passing custom mime types as string

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36715
| License       | MIT
| Doc PR        | none
Fix's issue where custom mimetypes were failing

Commits
-------

f3005ec653 Fix for #36715
2020-05-09 14:32:08 +02:00
Paul L. McNeely
f3005ec653
Fix for #36715 2020-05-09 07:22:40 -05:00
Nicolas Grekas
99d5818489 minor #36771 [HttpClient] test that timeout is not fatal (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] test that timeout is not fatal

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

Commits
-------

36ccf4c65b [HttpClient] test that timeout is not fatal
2020-05-09 14:10:26 +02:00
Nicolas Grekas
36ccf4c65b [HttpClient] test that timeout is not fatal 2020-05-09 14:08:40 +02:00
Nicolas Grekas
3783200074 minor #36761 [PhpUnitBridge] fix bad test (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] fix bad test

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

Mutating the global state of the autoloader... terrible idea. This should fix tests and remove the lines we were wondering about in the CI:
`Undefined index: remaining selfCount in [...]`

Commits
-------

edb517699a [PhpUnitBridge] fix bad test
2020-05-08 14:34:26 +02:00
Nicolas Grekas
edb517699a [PhpUnitBridge] fix bad test 2020-05-08 14:32:38 +02:00
Nicolas Grekas
da8b9552ad Merge branch '3.4' into 4.4
* 3.4:
  [3.4] CS fixes
2020-05-08 12:54:34 +02:00
Nicolas Grekas
020fa77db9 minor #36757 [4.4] CS fixes (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[4.4] CS fixes

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

Commits
-------

eba09d47e7 [4.4] CS fixes
2020-05-08 12:54:24 +02:00
Nicolas Grekas
1e1060f2eb minor #36756 [3.4] CS fixes (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[3.4] CS fixes

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

Commits
-------

02b378f248 [3.4] CS fixes
2020-05-08 12:53:15 +02:00
Nicolas Grekas
eba09d47e7 [4.4] CS fixes 2020-05-08 12:39:41 +02:00
Nicolas Grekas
02b378f248 [3.4] CS fixes 2020-05-08 12:38:31 +02:00
Nicolas Grekas
66cd9f470c Disable phpunit verbosity 2020-05-08 12:04:27 +02:00
Nicolas Grekas
e75c227d79 bug #36747 Queue name is a required parameter (theravel)
This PR was submitted for the 5.0 branch but it was merged into the 4.4 branch instead.

Discussion
----------

Queue name is a required parameter

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

Queue name is required parameter, which means this block will just fail

Commits
-------

9d48eedbdc Queue name is a required parameter
2020-05-08 12:02:38 +02:00
theravel
9d48eedbdc Queue name is a required parameter 2020-05-08 12:02:31 +02:00
Nicolas Grekas
a60937519b bug #36751 [Mime] fix bad method call on EmailAddressContains (Kocal)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mime] fix bad method call on `EmailAddressContains`

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | -
| License       | MIT
| Doc PR        | -

There is no method `Address` on [`MailboxHeader`](https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/Mime/Header/MailboxHeader.php), but a method `getAddress`.

Commits
-------

227ebd2fe9 [Mime] fix bad method call on "EmailAddressContains"
2020-05-08 11:59:36 +02:00
Nicolas Grekas
2dbfeb9db9 Merge branch '3.4' into 4.4
* 3.4:
  [FrameworkBundle] display actual target for error in AssetsInstallCommand
  Remove patches for Doctrine bugs and deprecations
  [DI][EventDispatcher] added contract for implementation
2020-05-08 11:58:40 +02:00
Nicolas Grekas
f6ae18e3ac minor #36710 [DI][EventDispatcher] added contract for implementation (bestform)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI][EventDispatcher] added contract for implementation

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

As described in the attached issue a comment in the documentation of the `EventSubscriberInterface` would be helpful to make sure users do not use logic based on runtime state in their implementation of `getSubscribedEvents`.

Commits
-------

88e43d4d4c [DI][EventDispatcher] added contract for implementation
2020-05-08 11:57:02 +02:00
Nicolas Grekas
94482fe1be minor #36726 [FrameworkBundle] display actual target for error in AssetsInstallCommand (NerdyProjects)
This PR was submitted for the 4.4 branch but it was merged into the 3.4 branch instead.

Discussion
----------

[FrameworkBundle] display actual target for error in AssetsInstallCommand

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? |no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       |
| License       | MIT

When assets:install fails because the target directory does not exist, it should display the actual directory it wanted to have instead of the configuration directive. In most cases, the target directory is retrieved from the kernel config and thus differs from the argument.

Commits
-------

f177b3d488 [FrameworkBundle] display actual target for error in AssetsInstallCommand
2020-05-08 11:56:21 +02:00
Matthias Larisch
f177b3d488 [FrameworkBundle] display actual target for error in AssetsInstallCommand
When assets:install fails because the target directory does not exist, it should display the actual directory it wanted to have instead of the configuration directive. In most cases, the target directory is retrieved from the kernel config and thus differs from the argument.
2020-05-08 11:56:06 +02:00
Nicolas Grekas
9b088bb014 minor #36744 Remove patches for Doctrine bugs and deprecations (greg0ire)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

Remove patches for Doctrine bugs and deprecations

| 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       | n/a
| License       | MIT
| Doc PR        | n/a

This PR removes patches put in place because of a bug fixed in doctrine/dbal#3994, and because of deprecations addressed in doctrine/orm#7953

Commits
-------

2f305cdc83 Remove patches for Doctrine bugs and deprecations
2020-05-08 11:45:19 +02:00
Grégoire Paris
2f305cdc83 Remove patches for Doctrine bugs and deprecations 2020-05-08 11:45:13 +02:00
Hugo Alliaume
227ebd2fe9
[Mime] fix bad method call on "EmailAddressContains"
There is no method `Address` on `MailboxHeader`, but a method `getAddress`.
2020-05-08 10:53:13 +02:00
Gocha Ossinkine
2e99caacaf [Yaml] Fix escaped quotes in quoted multi-line string 2020-05-07 22:33:48 +05:00
Nicolas Grekas
5c24718b1e [travis] Fix CI 2020-05-05 19:12:03 +02:00
Matthias Derer
88e43d4d4c [DI][EventDispatcher] added contract for implementation
fixes #36708.
2020-05-05 17:06:23 +02:00
Nicolas Grekas
f8bedf4e79 Merge branch '3.4' into 4.4
* 3.4:
  Force doctrine/dbal <=2.10.2 when testing
2020-05-05 15:52:57 +02:00
Nicolas Grekas
a8b5b15c25 minor #36707 Force doctrine/dbal <=2.10.2 when testing (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

Force doctrine/dbal <=2.10.2 when testing

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

Until https://github.com/doctrine/dbal/issues/3990 is resolved.

Commits
-------

d1953d61cd Force doctrine/dbal <=2.10.2 when testing
2020-05-05 15:52:00 +02:00
Nicolas Grekas
d1953d61cd Force doctrine/dbal <=2.10.2 when testing 2020-05-05 15:43:18 +02:00
Fabien Potencier
cf6e499baf bug #36696 [Console] don't check tty on stdin, it breaks with "data lost during stream conversion" (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] don't check tty on stdin, it breaks with "data lost during stream conversion"

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

/cc @ostrolucky FYI

Commits
-------

6d089ac437 [Console] fix "data lost during stream conversion" with QuestionHelper
2020-05-05 13:55:38 +02:00
Nicolas Grekas
6d089ac437 [Console] fix "data lost during stream conversion" with QuestionHelper 2020-05-05 13:09:20 +02:00
Nicolas Grekas
2732dda83c Merge branch '3.4' into 4.4
* 3.4:
  [PhpUnitBridge] fix PHP 5.3 compat
  [PhpUnitBridge] Mark parent class also covered in CoverageListener
  prevent notice for invalid octal numbers on PHP 7.4
2020-05-05 09:39:02 +02:00
Nicolas Grekas
f7fc3cf6cb [PhpUnitBridge] fix PHP 5.3 compat 2020-05-05 09:38:03 +02:00
Fabien Potencier
9b8911598b bug #36569 [PhpUnitBridge] Mark parent class also covered in CoverageListener (lyrixx)
This PR was merged into the 3.4 branch.

Discussion
----------

[PhpUnitBridge] Mark parent class also covered in CoverageListener

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

Commits
-------

dcb5653728 [PhpUnitBridge] Mark parent class also covered in CoverageListener
2020-05-05 07:34:36 +02:00
Fabien Potencier
6340e87755 bug #36690 [Yaml] prevent notice for invalid octal numbers on PHP 7.4 (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Yaml] prevent notice for invalid octal numbers on PHP 7.4

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

Commits
-------

92bc19fd0c prevent notice for invalid octal numbers on PHP 7.4
2020-05-05 07:30:40 +02:00
Grégoire Pineau
dcb5653728 [PhpUnitBridge] Mark parent class also covered in CoverageListener 2020-05-05 00:33:45 +02:00
Christian Flothmann
92bc19fd0c prevent notice for invalid octal numbers on PHP 7.4 2020-05-04 18:58:31 +02:00
Nicolas Grekas
b0573cb418 Merge branch '3.4' into 4.4
* 3.4:
  Fix exception messages containing exception messages
2020-05-04 17:32:48 +02:00
Nicolas Grekas
cfa048c804 minor #36684 Fix exception messages containing exception messages (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

Fix exception messages containing exception messages

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

Commits
-------

169e49d491 Fix exception messages containing exception messages
2020-05-04 17:20:19 +02:00
Nicolas Grekas
169e49d491 Fix exception messages containing exception messages 2020-05-04 17:12:51 +02:00
Nicolas Grekas
394946de47 Merge branch '3.4' into 4.4
* 3.4:
  [Filesystem] Handle paths on different drives
  [WebProfiler] Do not add src-elem CSP directives if they do not exist
  [Yaml] fix parse error when unindented collections contain a comment
  [3.4][Inflector] Improve testSingularize() argument name
  [PhpUnitBridge] fix PHP 5.3 compat again
  Skip validation when email is an empty object
  fix sr_Latn translation
  [Validator] fix lazy property usage.
  Fix annotation
  [PhpUnitBridge] fix compat with PHP 5.3
  [DX] Show the ParseException message in YAML file loaders
2020-05-04 16:02:18 +02:00
Fabien Potencier
64e5a9dee8 bug #36590 [Console] Default hidden question to 1 attempt for non-tty session (ostrolucky)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] Default hidden question to 1 attempt for non-tty session

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

### Problem 1
`validateAttempts()` method repeats validation forever by default, until exception extending `RuntimeException` isn't thrown. This currently happens disregarding if user is in tty session where they can actually type input, or non-tty session. This presents a problem when user code throws custom exceptions for hidden questions -> loop doesn't stop. As far as I can tell this issue is in all Symfony versions, but it was uncovered only after we stopped marking interactive flag to false automatically ourselves. Actually, all 3 problems were already existing problems, just hidden until now.
### Problem 2
Infinite loop problem is related to hidden questions, but this one isn't. If validation fails, another attempt to read & validate happens. This means user will get two prompts: 2x same question with 2 different error messages. One error message coming from validator, second error message about inability to read input (because this loop repeats until this kind of error happens, so last output will always be this error). As an example, output in practice would look like following
```

 What do you want to do:
 >

 [ERROR] Action must not be empty.

 What do you want to do:
 >

  Aborted.

```

So even if loop stops, output is more than expected.

### Problem 3
This is purely cosmetic issue, but currently user gets `stty: stdin isn't a terminal` printed additionally when question helper tries to ask a hidden question without having tty. I have fixed this in same fashion as was already done for [getShell() method](ee7fc5544e/src/Symfony/Component/Console/Helper/QuestionHelper.php (L500)).

### More details
Well root of the first problem is that `\Symfony\Component\Console\Helper\QuestionHelper::getHiddenResponse` is inconsistent. In some cases it does throw `MissingInputException` (which extends `RuntimeException`), in others doesn't. This is because in others, `shell_exec` is used, which won't return `false` even in non-tty sessions. Initially I attempted to fix this and make them consistent by checking for empty result + `isTty` call, but during my testing I found that at least last, `bash -c` method returns `\n` as output both when passing empty input and when passing newline as input. This means we cannot differentiate with this technique when input is really empty, or at least I can't currently tell how, maybe someone does. I had also idea to use proc_open and check if `STDERR` cotains message about stdin not being a terminal, but I realized these functions might not be available. In future we should modernize this method to use less hacky techniques. Other solutions, eg. Inquirer.js or [hoa/console](https://github.com/hoaproject/Console/blob/master/Source/Readline/Readline.php) have much more elegant solutions. Anyway, since I encountered this issue and additionally this doesn't solve Problem 2, I stopped trying to fix this on this level.

### Alternative solution
Alternative solution to problem 1 and 3 would be to fallback to default in case of hidden questions when tty is missing. But this still doesn't solve problem 2 and I can't think about solution right now which would fix problem 2 separately. We also didn't really reach consensus if reading passwords via stdin is desired. I tried this in `Inquirer.js` and this library *does read password from stdin*

Commits
-------

ee7fc5544e [Console] Default hidden question to 1 attempt for non-tty session
2020-05-04 15:57:21 +02:00
Nicolas Grekas
bd952b9c47 bug #36497 [Filesystem] Handle paths on different drives (crishoj)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Filesystem] Handle paths on different drives

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

`makePathRelative` strips and ignores the drive letters given Windows paths on different drives, resulting in a relative path which does not resolve to the desired target.

This PR makes `makePathRelative` notice paths on different drives, and return the full (absolute) target path in case instead.

Commits
-------

00e727ae4e [Filesystem] Handle paths on different drives
2020-05-04 15:48:43 +02:00
Christian Rishøj
00e727ae4e [Filesystem] Handle paths on different drives 2020-05-04 15:48:34 +02:00