Commit Graph

25523 Commits

Author SHA1 Message Date
Nicolas Grekas 3a470c4ecf [Process] Check PHP_BINDIR before $PATH in PhpExecutableFinder 2018-02-04 17:22:42 +01:00
Nicolas Grekas 478fbdc241 bug #25373 Use the PCRE_DOLLAR_ENDONLY modifier in route regexes (mpdude)
This PR was squashed before being merged into the 2.7 branch (closes #25373).

Discussion
----------

Use the PCRE_DOLLAR_ENDONLY modifier in route regexes

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

`UrlMatcher::match($pathinfo)` applies `rawurldecode()` to the `$pathinfo` before trying to match it against the routes.

If the URL contains a percent-encoded trailing newline (like in `/foo%0a`), the default PHP PCRE will still consider `#^/foo$#` a match, as the `$` metacharacter will also match *immediately before* the final character *if it is a newline*. This behavior can be changed by applying the [`PCRE_DOLLAR_ENDONLY` modifier](http://php.net/manual/en/reference.pcre.pattern.modifiers.php).

Without this change, URLs with trailing `%0a` lead to weird notices further down the road, for example when the `RedirectableUrlMatcher` or its equivalent in `PhpMatcherDumper` kick in, look at the last character (this time actually the newline), append a `/` and try to redirect to the resulting URL. Ultimately, PHP will complain with `Warning: Header may not contain more than a single header, new line detected` when sending the `Location` header.

Commits
-------

f713a3e Use the PCRE_DOLLAR_ENDONLY modifier in route regexes
2018-02-04 16:51:07 +01:00
Matthias Pigulla f713a3e879 Use the PCRE_DOLLAR_ENDONLY modifier in route regexes 2018-02-04 16:50:24 +01:00
Nicolas Grekas c219755f17 minor #26039 [travis] cache compiled php extensions (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[travis] cache compiled php extensions

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

Should save more that 80s per job on PHP 7 esp.

Commits
-------

b9def8a [travis] cache compiled php extensions
2018-02-04 13:53:07 +01:00
Nicolas Grekas b9def8ab50 [travis] cache compiled php extensions 2018-02-04 10:47:47 +01:00
Nicolas Grekas 1111da7363 bug #26010 [CssSelector] For AND operator, the left operand should have parentheses, not only right operand (Arnaud CHASSEUX)
This PR was merged into the 2.7 branch.

Discussion
----------

[CssSelector] For AND operator, the left operand should have parentheses, not only right operand

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

From https://github.com/symfony/css-selector/pull/3

Commits
-------

76b40dc [CssSelector] For AND operator, the left operand should have parentheses, not only right operand
2018-02-03 12:00:12 +01:00
Arnaud CHASSEUX 76b40dc10e [CssSelector] For AND operator, the left operand should have parentheses, not only right operand 2018-02-03 11:49:50 +01:00
Nicolas Grekas d0e03a4bbe minor #26029 Removed unused parameter from flattenDataProvider() (derrabus)
This PR was merged into the 2.7 branch.

Discussion
----------

Removed unused parameter from flattenDataProvider()

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no, but unrelated
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | N/A

While working on #26028, I noticed that FlattenExceptionTest::FlattenExceptionTest.php() exposes two arguments although all tests consuming that provider only use the first one. This PR removes the unnecessary second argument.

Commits
-------

d6f4f51 Removed unused parameter from flattenDataProvider().
2018-02-03 11:40:13 +01:00
Nicolas Grekas dbe5b14620 minor #26018 Update MongoDB extension on travis to make the builds green again (derrabus)
This PR was merged into the 2.7 branch.

Discussion
----------

Update MongoDB extension on travis to make the builds green again

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

Currently, php 7.1 and 7.2 runs on travis are failing because we're testing against `mongodb/mongodb` 1.3-dev which requires a more recent version of `ext-mongodb` than Travis provides.

This PR attempts to fix the issue by installing that version via PECL.

Commits
-------

e0132cc Update MongoDB extension on travis to make the builds green again.
2018-02-03 11:27:25 +01:00
Alexander M. Turek d6f4f5129e Removed unused parameter from flattenDataProvider(). 2018-02-03 01:09:36 +01:00
Fabien Potencier b49a6b7fa3 minor #26016 [Intl] Fixed the broken link (bocharsky-bw)
This PR was merged into the 2.7 branch.

Discussion
----------

[Intl] Fixed the broken link

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

From https://github.com/symfony/intl/pull/6

Commits
-------

5733e02960 [Intl] Fixed the broken link
2018-02-02 14:04:48 +01:00
Alexander M. Turek e0132cc5d7 Update MongoDB extension on travis to make the builds green again. 2018-02-02 12:44:37 +01:00
Victor Bocharsky 5733e02960 [Intl] Fixed the broken link 2018-02-02 10:30:16 +01:00
Fabien Potencier 0924c001f9 bug #25971 [Debug] Fix bad registration of exception handler, leading to mem leak (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Debug] Fix bad registration of exception handler, leading to mem leak

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

Commits
-------

926b1bee18 [Debug] Fix bad registration of exception handler, leading to mem leak
2018-02-01 05:48:20 +01:00
Fabien Potencier ceb4e73e83 bug #25962 [Routing] Fix trailing slash redirection for non-safe verbs (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Routing] Fix trailing slash redirection for non-safe verbs

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

This test dumped matchers using the existing test cases for (Redirectable)UrlMatcher so that we are sure they behave the same. Fixes the differences found while doing so.

Commits
-------

ad593aef2f [Routing] Fix trailing slash redirection for non-safe verbs
2018-02-01 05:28:18 +01:00
Fabien Potencier 471c410ce6 bug #25948 [Form] Fixed empty data on expanded ChoiceType and FileType (HeahDude)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Fixed empty data on expanded ChoiceType and FileType

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

Alternative of https://github.com/symfony/symfony/pull/25924.

I don't think we have to do this by adding overhead in master and getting it properly fixed in 2 years.

This is bug I've introduced while fixing another bug #17822. Which then has been replicated in #20418 and #24993.

I propose instead to clean up the code for all LTS, since this is a wrong behaviour that has never been documented, and most of all unreliable.
The `empty_data` can by anything in the view format as long as the reverse view transformation supports it. Even an object derived from the data class could be invokable.

I think we should remain consistent with https://github.com/symfony/symfony/blob/2.7/src/Symfony/Component/Form/Form.php#L615.

Commits
-------

9722c063fb [Form] Fixed empty data on expanded ChoiceType and FileType
2018-02-01 05:22:43 +01:00
Nicolas Grekas ad593aef2f [Routing] Fix trailing slash redirection for non-safe verbs 2018-01-31 11:33:59 +01:00
Nicolas Grekas c61f94122f minor #25970 [TwigBridge] update test for Twig performance optimizations (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[TwigBridge] update test for Twig performance optimizations

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | twigphp/Twig#2617
| License       | MIT
| Doc PR        |

Commits
-------

21bbad9 update test for Twig performance optimizations
2018-01-31 10:08:15 +01:00
Nicolas Grekas 1c58dcf949 bug #25972 support sapi_windows_vt100_support for php 7.2+ (jhdxr)
This PR was merged into the 2.7 branch.

Discussion
----------

support sapi_windows_vt100_support for php 7.2+

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

php 7.2 enabled color support on windows(>=10.0.10586) and introduced a new function called `sapi_windows_vt100_support` to get and set the state. this PR add the support for this new function, so users on windows can see the colorful world again with php 7.2+.

Commits
-------

5bbb77b support sapi_windows_vt100_support for php 7.2+
2018-01-31 10:06:53 +01:00
Christian Flothmann 21bbad93f0 update test for Twig performance optimizations 2018-01-30 17:25:32 +01:00
Javier Eguiluz b9bb577834 minor #25967 [WebProfilerBundle] Increase retry delays between toolbarAction ajax calls (JoeKre)
This PR was submitted for the master branch but it was squashed and merged into the 2.7 branch instead (closes #25967).

Discussion
----------

[WebProfilerBundle] Increase retry delays between toolbarAction ajax calls

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

Commits
-------

3288fb0d17 [WebProfilerBundle] Increase retry delays between toolbarAction ajax calls
2018-01-30 17:18:54 +01:00
Joachim Krempel 3288fb0d17 [WebProfilerBundle] Increase retry delays between toolbarAction ajax calls 2018-01-30 17:18:42 +01:00
蝦米 5bbb77b866 support sapi_windows_vt100_support for php 7.2+ 2018-01-30 23:53:25 +08:00
Nicolas Grekas 926b1bee18 [Debug] Fix bad registration of exception handler, leading to mem leak 2018-01-30 16:14:37 +01:00
Fabien Potencier c6453353d4 bug #25744 [TwigBridge] Allow label translation to be safe (MatTheCat)
This PR was merged into the 2.7 branch.

Discussion
----------

[TwigBridge] Allow label translation to be safe

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

After overriding `TranslationExtension`'s `trans` filter to make it safe I noticed form labels were still escaped because of `label` in

```twig
{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}
```

Replacing this ternary with `if`/`else` allows `trans` return to be safe.

WDYT?

Commits
-------

041c42db6a Allow trans filter to be safe
2018-01-30 14:54:38 +01:00
Greg Anderson 35f98e2089 Follow-on to #25825: Fix edge case in getParameterOption.
Add one test to demonstrate getParameterOption fix. Add several tests to demonstrate current limitations in hasParameterOption.
2018-01-29 09:39:17 -08:00
Fabien Potencier 1ee3950b73 bumped Symfony version to 2.7.42 2018-01-29 11:46:38 +01:00
Fabien Potencier 8b2b59d62f
Merge pull request #25953 from fabpot/release-2.7.41
released v2.7.41
2018-01-29 11:08:56 +01:00
Fabien Potencier 87580b1fd2 updated VERSION for 2.7.41 2018-01-29 11:08:39 +01:00
Fabien Potencier 50931d83f5 update CONTRIBUTORS for 2.7.41 2018-01-29 11:08:31 +01:00
Fabien Potencier 6d59c13e71 updated CHANGELOG for 2.7.41 2018-01-29 11:08:21 +01:00
Fabien Potencier 8339a7b165 minor #25878 [HttpFoundation] Added "null" type on Request::create docblock (keradus)
This PR was squashed before being merged into the 2.7 branch (closes #25878).

Discussion
----------

[HttpFoundation] Added "null" type on Request::create docblock

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | n/a
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Continuation of #24902 and #25875

Commits
-------

b18f9e76a5 [HttpFoundation] Added "null" type on Request::create docblock
2018-01-29 10:18:42 +01:00
Dariusz b18f9e76a5 [HttpFoundation] Added "null" type on Request::create docblock 2018-01-29 10:18:40 +01:00
Fabien Potencier e395e56b6b minor #25943 Removed assertDateTimeEquals() methods (derrabus)
This PR was merged into the 2.7 branch.

Discussion
----------

Removed assertDateTimeEquals() methods

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

All PHPUnit versions that we use on Travis support comparing `DateTime` objects via `assertEquals()`. Yet, we have our own code in place to check for equality of `DateTime` objects. This PR removes that code.

Commits
-------

5b73d1c1e6 Removed assertDateTimeEquals() methods.
2018-01-29 09:57:25 +01:00
Fabien Potencier d007bbd2e5 minor #25907 Improve assertions (carusogabriel)
This PR was merged into the 2.7 branch.

Discussion
----------

Improve assertions

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

Following #25420 before start other branches.

Btw, the other branches are 2.8, 3.3, 3.4, 4.0 and master?

Commits
-------

3d90a2217d Improve assertions
2018-01-29 09:53:47 +01:00
Fabien Potencier 5e3aa676eb bug #25922 [HttpFoundation] Use the correct syntax for session gc based on Pdo driver (tanasecosminromeo)
This PR was submitted for the master branch but it was squashed and merged into the 2.7 branch instead (closes #25922).

Discussion
----------

[HttpFoundation] Use the correct syntax for session gc based on Pdo driver

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

The initial fix for #24456 was wrong, since it only accounted for Postgres. @WhiteEagle88 correctly identified #25665 - but having time as SIGNED is ... off, since time shouldn't be negative. Using CAST to solve this issue surely has a performance penalty, so I believe the best approach is to have a switch based on the driver.

Commits
-------

826dfbd496 [HttpFoundation] Use the correct syntax for session gc based on Pdo driver
2018-01-29 09:51:56 +01:00
Cosmin-Romeo TANASE 826dfbd496 [HttpFoundation] Use the correct syntax for session gc based on Pdo driver 2018-01-29 09:51:44 +01:00
Jules Pietri 9722c063fb [Form] Fixed empty data on expanded ChoiceType and FileType 2018-01-28 12:59:04 +01:00
Alexander M. Turek 5b73d1c1e6 Removed assertDateTimeEquals() methods. 2018-01-27 12:01:42 +01:00
Christian Flothmann 317da3bdf8 keep the context when validating forms 2018-01-26 18:01:03 +01:00
Fabien Potencier 4f47bb73a0 Revert "bug #24987 [Console] Fix global console flag when used in chain (Simperfit)"
This reverts commit 9107fb0afd, reversing
changes made to abe6e92593.
2018-01-26 16:25:25 +01:00
Fabien Potencier 667b9295f8 Revert "bug #25487 [Console] Fix a bug when passing a letter that could be an alias (Simperfit)"
This reverts commit ccc93678fd, reversing
changes made to e77545ab8d.
2018-01-26 16:23:25 +01:00
Fabien Potencier 554bc2482e bug #25933 Disable CSP header on exception pages only in debug (ostrolucky)
This PR was merged into the 2.7 branch.

Discussion
----------

Disable CSP header on exception pages only in debug

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

Based on a feedback we received, there are situations on production when it's desired to have CSP header in place even if exception occurred.

This uses now same condition that is used by ExceptionController in TwigBridge to evaluate if styled exception template is going to be shown, minus `showException` request attribute which don't make sense in this context, because it's used by PreviewController only and in such case this listener isn't triggered.

Overriding CSP header via HTML meta tag unfortunately, but not surprisingly, doesn't work.

Commits
-------

b77538c2fe Disable CSP header on exception pages only in debug
2018-01-26 16:01:34 +01:00
Fabien Potencier ba8fb60bbd bug #25926 [Form] Fixed Button::setParent() when already submitted (HeahDude)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Fixed Button::setParent() when already submitted

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

The `Button` does not respect the [FormInterface](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/FormInterface.php#L28), by extension the `SubmitButton` neither.

Commits
-------

9f0c7bf549 Fixed Button::setParent() when already submitted
2018-01-26 15:13:14 +01:00
Fabien Potencier 0cd675ca4a bug #25927 [Form] Fixed submitting disabled buttons (HeahDude)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Fixed submitting disabled buttons

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

Commits
-------

804b2a1a47 Fixed submitting disabled buttons
2018-01-26 08:31:44 +01:00
Gabriel Ostrolucký b77538c2fe Disable CSP header on exception pages only in debug
Same condition is used by default TwigBridge ExceptionController
to evaluate if styled exception page is supposed to be shown.
2018-01-26 02:39:48 +01:00
HeahDude 804b2a1a47 Fixed submitting disabled buttons 2018-01-25 12:52:22 +01:00
Jules Pietri 9f0c7bf549 Fixed Button::setParent() when already submitted 2018-01-25 12:47:49 +01:00
Gabriel Caruso 3d90a2217d Improve assertions 2018-01-24 15:56:32 -02:00
Mathieu Lechat 041c42db6a Allow trans filter to be safe 2018-01-24 13:24:39 +01:00