Commit Graph

25909 Commits

Author SHA1 Message Date
Robin Chalas
e64de1eac6 [Console] Fix infinite loop on missing input
[Console] Use console exception for missing input

Backport Console RuntimeException in 2.7
2016-11-03 09:51:57 +01:00
Nicolas Grekas
2b0cec528a Remove trailing space 2016-11-03 09:05:06 +01:00
Nicolas Grekas
37956db606 Merge branch '2.7' into 2.8
* 2.7:
  CS fixes
  Remove trailing space
  CS: apply rules
  [Yaml] Clean some messages + add test case
  [Form] Fix UrlType transforms valid protocols
  [SecurityBundle] Changed encoder configuration example to bcrypt
2016-11-03 08:52:58 +01:00
Nicolas Grekas
4eb003b653 CS fixes 2016-11-03 08:49:30 +01:00
Nicolas Grekas
1b4963bd84 Remove trailing space 2016-11-03 08:46:56 +01:00
Nicolas Grekas
0aca495522 minor #20364 CS: apply rules (keradus)
This PR was squashed before being merged into the 2.7 branch (closes #20364).

Discussion
----------

CS: apply rules

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

Commits
-------

22d4e15 CS: apply rules
2016-11-03 08:44:55 +01:00
Dariusz Ruminski
22d4e15634 CS: apply rules 2016-11-03 08:44:53 +01:00
Fabien Potencier
df130a35e4 minor #20388 [Yaml] Clean some messages + add test case (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Yaml] Clean some messages + add test case

| 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        | -

Related to #20335 on 3.2.

Commits
-------

7520f7b [Yaml] Clean some messages + add test case
2016-11-02 14:11:25 -07:00
Nicolas Grekas
7520f7b937 [Yaml] Clean some messages + add test case 2016-11-02 15:01:29 +01:00
VJ
0423d894f4 [HttpFoundation][Session] memcached connection should not be closed 2016-11-02 08:42:51 -04:00
Fabien Potencier
779a6df81c bug #20372 [Console] simplified code (fabpot)
This PR was merged into the 2.8 branch.

Discussion
----------

[Console] simplified code

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | ~no~ yes (even if the output is "better" with this PR)
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Instead of adding blank character for shorter lines and having to keep the max length of messages, I propose to clear the line via an ANSI sequence like done in the progress bar.

Code is cleaner and output is better as currently, then cursor can be "away" from the last character which is unexpected.

Actually, this is a bug fix as the current code does not work well when using styles in the indicator message.

Commits
-------

0aca9bf [Console] simplified code
2016-10-31 12:36:25 -07:00
Fabien Potencier
0aca9bf03c [Console] simplified code 2016-10-31 11:03:18 -07:00
Fabien Potencier
620ea20f49 bug #20342 [Form] Fix UrlType transforms valid protocols (ogizanagi)
This PR was submitted for the 2.8 branch but it was merged into the 2.7 branch instead (closes #20342).

Discussion
----------

[Form] Fix UrlType transforms valid protocols

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

According to https://tools.ietf.org/html/rfc3986#section-3.1:

<details>
<summary>`scheme      = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )`</summary>
>   Each URI begins with a scheme name that refers to a specification for
   assigning identifiers within that scheme.  As such, the URI syntax is
   a federated and extensible naming system wherein each scheme's
   specification may further restrict the syntax and semantics of
   identifiers using that scheme.

>   Scheme names consist of a sequence of characters beginning with a
   letter and followed by any combination of letters, digits, plus
   ("+"), period ("."), or hyphen ("-").  Although schemes are case-
   insensitive, the canonical form is lowercase and documents that
   specify schemes must do so with lowercase letters.  An implementation
   should accept uppercase letters as equivalent to lowercase in scheme
   names (e.g., allow "HTTP" as well as "http") for the sake of
   robustness but should only produce lowercase scheme names for
   consistency.
</details>

~~Fixing the regex to add missing chars could solve the issue. However according to the RFC, we should not allow underscores. But `\w+` permits it (removing it would be a minor BC break anyway).~~

~~IMHO, we should not care in this listener if the scheme is valid or not (a validator should be used instead), so I'd suggest to simply check if a scheme is provided or not.~~ I'm not using `parse_url($string, PHP_URL_SCHEME)` because `http:/symfony.com` or `http:symfony.com`  is considered valid as containing a scheme.

Actually, I changed my mind about previous fix (28f816a) and went back to the regex, in order to have strings like `symfony.com?uri=http://example.com` properly transformed to `symfony.com?uri=http://example.com`

Commits
-------

46dd3b9 [Form] Fix UrlType transforms valid protocols
2016-10-30 08:33:18 -07:00
Maxime STEINHAUSSER
46dd3b9acb [Form] Fix UrlType transforms valid protocols 2016-10-30 08:33:18 -07:00
Fabien Potencier
16b29a16de minor #20301 [SecurityBundle] Changed encoder configuration example to bcrypt (jeremyFreeAgent)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #20301).

Discussion
----------

[SecurityBundle] Changed encoder configuration example to bcrypt

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

Simple change in the configuration example to help developers to not use `sha512` as encoder when using `config:dump-reference`.

Commits
-------

a55058f [SecurityBundle] Changed encoder configuration example to bcrypt
2016-10-30 08:29:28 -07:00
Jérémy Romey
a55058f097 [SecurityBundle] Changed encoder configuration example to bcrypt 2016-10-30 08:29:28 -07:00
Nicolas Grekas
d12f26992b Merge branch '2.7' into 2.8
* 2.7:
  Compatibility with Twig 1.27
  Enhance GAE compat by removing some realpath()
  bumped Symfony version to 2.7.21
  updated VERSION for 2.7.20
  update CONTRIBUTORS for 2.7.20
  updated CHANGELOG for 2.7.20
  [SecurityBundle] Fix twig-bridge lowest dep
2016-10-28 10:10:49 +02:00
Fabien Potencier
0572866184 bug #20292 Enhance GAE compat by removing some realpath() (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

Enhance GAE compat by removing some realpath()

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

The remaining ones are in test folders, or in things that don't run/have to run on GAE directly (e.g. commands).

Commits
-------

f2f232d Enhance GAE compat by removing some realpath()
2016-10-27 08:37:53 -07:00
Fabien Potencier
74ed9e1941 bug #20326 [VarDumper] Fix dumping Twig source in stack traces (nicolas-grekas)
This PR was merged into the 2.8 branch.

Discussion
----------

[VarDumper] Fix dumping Twig source in stack traces

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

Commits
-------

f16d44d [VarDumper] Fix dumping Twig source in stack traces
2016-10-27 08:05:40 -07:00
Fabien Potencier
0d545b27a3 bug #20321 Compatibility with Twig 1.27 (xkobal)
This PR was submitted for the 3.1 branch but it was merged into the 2.7 branch instead (closes #20321).

Discussion
----------

Compatibility with Twig 1.27

| Q             | A
| ------------- | ---
| Branch?       | "master" for new features / 2.7, 2.8 or 3.1 for fixes
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | comma-separated list of tickets fixed by the PR, if any
| License       | MIT
| Doc PR        | reference to the documentation PR, if any

In FilesystemLoader::findTemplate(), you must accept a second argument that when set to "false" returns "false" instead of throwing an exception. Not supporting this argument is deprecated since version 1.27.

Commits
-------

77c5395 Compatibility with Twig 1.27
2016-10-27 07:46:29 -07:00
Xavier HAUSHERR
77c5395a79 Compatibility with Twig 1.27 2016-10-27 07:46:29 -07:00
Nicolas Grekas
f16d44dbc6 [VarDumper] Fix dumping Twig source in stack traces 2016-10-27 14:02:32 +02:00
Nicolas Grekas
f2f232d599 Enhance GAE compat by removing some realpath() 2016-10-27 11:13:40 +02:00
Fabien Potencier
5abd889480 bumped Symfony version to 2.8.14 2016-10-26 19:36:03 -07:00
Fabien Potencier
d04e2eb13a Merge pull request #20315 from fabpot/release-2.8.13
released v2.8.13
2016-10-26 19:18:45 -07:00
Fabien Potencier
10b7b5da3b updated VERSION for 2.8.13 2016-10-26 19:18:22 -07:00
Fabien Potencier
5ea7fcc92b updated CHANGELOG for 2.8.13 2016-10-26 19:18:10 -07:00
Fabien Potencier
ed11f22360 bumped Symfony version to 2.7.21 2016-10-26 19:12:15 -07:00
Fabien Potencier
d22e8e011c Merge pull request #20314 from fabpot/release-2.7.20
released v2.7.20
2016-10-26 18:37:30 -07:00
Fabien Potencier
8beacd2dd8 updated VERSION for 2.7.20 2016-10-26 18:37:19 -07:00
Fabien Potencier
7891a33175 update CONTRIBUTORS for 2.7.20 2016-10-26 18:37:04 -07:00
Fabien Potencier
3dadbe6e2f updated CHANGELOG for 2.7.20 2016-10-26 18:36:58 -07:00
Nicolas Grekas
8d1711a719 minor #20297 [SecurityBundle] Fix twig-bridge lowest dep (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[SecurityBundle] Fix twig-bridge lowest dep

| 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        | -

To make tests green again on 2.7

Commits
-------

6856faf [SecurityBundle] Fix twig-bridge lowest dep
2016-10-25 15:00:45 +02:00
Nicolas Grekas
6856faf6e5 [SecurityBundle] Fix twig-bridge lowest dep 2016-10-25 14:37:33 +02:00
Fabien Potencier
2011f447df Merge branch '2.7' into 2.8
* 2.7:
  Fix edge case with StreamedResponse where headers are sent twice
  removed usage of Twig_Compiler::addIndentation
  merge tags instead of completely replacing them
2016-10-24 08:52:36 -07:00
Fabien Potencier
6bca8afb31 bug #20289 Fix edge case with StreamedResponse where headers are sent twice (Nicofuma)
This PR was merged into the 2.7 branch.

Discussion
----------

Fix edge case with StreamedResponse where headers are sent twice

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

If you have PHPs output buffering enabled (`output_buffering=4096` in your php.ini per example), there is an edge case with the StreamedResponse object where the headers are sent twice. Even if it is harmless most of the time, it can be critical sometimes (per example, if an `Access-Control-Allow-Origin` header is duplicated the browser will block the request).

Explanation: because the streamed response may need the request in order to generate the content, the `StreamedResponseListener` class calls the send method of the `Response` when the event `kernel.response` is fired. To prevent the content from being duplicated, a state has been introduced in the `sendContent()` method and it works fine.

But there is an edge case is the headers of the response. If the content generated by the `sendContent()` method is smaller than the value defined for `output_buffering` in the `php.ini` then the buffer won't be flushed and the `headers_sent()` function will return false.
Therefore when `$response->send()` is called for the second time (in the `app.php` file), the headers will be sent a second time.

Commits
-------

a79991f Fix edge case with StreamedResponse where headers are sent twice
2016-10-24 08:51:37 -07:00
Tristan Darricau
a79991f44a
Fix edge case with StreamedResponse where headers are sent twice 2016-10-24 16:36:35 +02:00
Fabien Potencier
7b56cc0876 removed usage of Twig_Compiler::addIndentation 2016-10-23 22:48:00 -07:00
Fabien Potencier
ae68e66d7e bug #20267 [DependencyInjection] A decorated service should not keep the autowiring types (chalasr)
This PR was merged into the 2.8 branch.

Discussion
----------

[DependencyInjection] A decorated service should not keep the autowiring types

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/20260#issuecomment-255364862
| License       | MIT
| Doc PR        | n/a

When decorating a service which is not abstract and has `autowiring_types`, the decorator should be the one used for autowiring methods of autowired services, so we should explicitly empty them on the decorated definition after merged them into the child. See  https://github.com/symfony/symfony/pull/20260#issuecomment-255364862 for a use case where we are forced to manually empty the decorated service's `autowiring_types`.

Commits
-------

5951378 A decorated service should not keep the autowiring types
2016-10-23 08:08:37 -07:00
Fabien Potencier
7f3ce9af83 bug #20278 [DependencyInjection] merge tags instead of completely replacing them (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[DependencyInjection] merge tags instead of completely replacing them

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

In #20207, I missed the `array_merge()` call. Thus, previously set tags of the decorating service would have been discarded by the compiler pass.

Commits
-------

c333eb7 merge tags instead of completely replacing them
2016-10-23 08:03:30 -07:00
Robin Chalas
5951378727
A decorated service should not keep the autowiring types 2016-10-23 11:04:13 +02:00
Christian Flothmann
c333eb70b6 merge tags instead of completely replacing them 2016-10-23 08:52:28 +02:00
Fabien Potencier
5dfaf584fb Merge branch '2.7' into 2.8
* 2.7:
  [TwigBundle] fixed usage of getSource in tests
  Trim constant values in XmlFileLoader
  move test to the HttpKernel component
  [TwigBridge] fixed Twig_Source required argument
2016-10-22 18:13:14 -07:00
Fabien Potencier
122ac67823 bug #20271 Changes related to Twig 1.27 (fabpot)
This PR was merged into the 2.7 branch.

Discussion
----------

Changes related to Twig 1.27

| 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

Commits
-------

317d46f [TwigBundle] fixed usage of getSource in tests
b9a4586 [TwigBridge] fixed Twig_Source required argument
2016-10-22 08:17:41 -07:00
Fabien Potencier
317d46f249 [TwigBundle] fixed usage of getSource in tests 2016-10-22 08:04:15 -07:00
Fabien Potencier
0c551b5236 minor #20273 [FrameworkBundle][HttpKernel] move test to the HttpKernel component (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle][HttpKernel] move test to the HttpKernel component

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/19443#discussion_r83414612
| License       | MIT
| Doc PR        |

The moved test case does not test the `AddConsoleCommandPass` class, but ensures certain behavior in the `registerCommands()` method of the `Bundle` class from the HttpKernel component.

Commits
-------

c9ca322 move test to the HttpKernel component
2016-10-22 07:38:20 -07:00
Fabien Potencier
d5d84f6900 bug #20252 Trim constant values in XmlFileLoader (lstrojny)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #20252).

Discussion
----------

Trim constant values in XmlFileLoader

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

When an XML config file gets long, it's nice to put the constant name into the next line like this:
```xml
<parameter key="som_very_very_long_constant_name" type="constant">
    Some\Namespace\That\Is\Sufficiently\Long\To\Require\A\LineBreak::someLongishConstantName
</parameter>
```

If that’s the case, `constant()` will try and find a constant including the spaces. While it is theoretically possible to have a constant in PHP that starts or ends with a space, it’s impossible for class constants and only doable using `define(" FOO ", …);`. So that’s probably an edge case we can ignore.

Commits
-------

f09e621 Trim constant values in XmlFileLoader
2016-10-22 07:36:57 -07:00
Lars Strojny
f09e6218f8 Trim constant values in XmlFileLoader 2016-10-22 07:36:57 -07:00
Christian Flothmann
c9ca322825 move test to the HttpKernel component 2016-10-22 11:18:43 +02:00
Fabien Potencier
b9a4586b24 [TwigBridge] fixed Twig_Source required argument 2016-10-21 18:08:29 -07:00