Commit Graph

16762 Commits

Author SHA1 Message Date
Daniel Beyer 1be266fea0 [Process] Make test AbstractProcessTest::testStartAfterATimeout useful again 2015-02-04 15:30:30 +01:00
Fabien Potencier b8e4b4af3d bug #13039 [HttpFoundation] [Request] fix baseUrl parsing to fix wrong path_info (rk3rn3r)
This PR was squashed before being merged into the 2.3 branch (closes #13039).

Discussion
----------

[HttpFoundation] [Request] fix baseUrl parsing to fix wrong path_info

Hi everyone!

We at trivago had an issue with the Request object. It seems that all versions of symfony 2.x and 3.x are affected from this (possible) bug (don't checked 1.x).
Here is the problem:

some old legacy pages are deployed in the Document Root, let's say /var/www/www.test.com/ .
one or more new applications based on symfony are deployed to /var/release/new_app1/ , /var/release/new_app2/ , ... .
in /var/www/www.test.com/ there is a symlink "app" to /var/release/new_app1/web, like:
/var/www/www.test.com/app --> /var/release/new_app1/web/

there is a "SEO"/human-readable rewrite rule for Document Root (if called path/file not exist): (.*) --> app/app.php

the problem comes, when the user calls a uri starting with "app" or whatever the rewrite rule / symlink points to:

the user calls "http://www.test.com/apparthotel-1234"
results in $_SERVER parameters like this
```
'DOCUMENT_ROOT' =>'/var/www/www.test.com',
'SCRIPT_FILENAME' => '/var/www/www.test.com/app/app.php',
'SCRIPT_NAME' => '/app/app.php',
'PHP_SELF' => '/app/app.php/apparthotel-1234'
```
in Request::prepareBaseUrl() there are checks to find the baseUrl:
```
        if ($baseUrl && false !== $prefix = $this->getUrlencodedPrefix($requestUri, $baseUrl)) {
            // full $baseUrl matches
            return $prefix;
        }

        if ($baseUrl && false !== $prefix = $this->getUrlencodedPrefix($requestUri, dirname($baseUrl))) {
            // directory portion of $baseUrl matches
            return rtrim($prefix, '/');
        }
```
first it is checked if (in our case) "/app/app.php" is in the request uri (/apparthotel-1234).
it's not.

then it takes the dirname (of /app/app.php) which is /app and checks if it is in the request uri (/apparthotel-1234), and YES, it is! and "/app" is returned, but this is wrong, it should be empty (because it comes from a rewrite rule from root: /)!

later in preparePathInfo(), if there is a baseUrl, then the baseUrl is removed from the request uri:
/apparthotel-1234  --->  /arthotel-1234

The cause is, the second baseUrl check, checks if the path of the application is already in the uri, like when the request was "http://www.test.com/app/apparthotel-1234" and hit a rewrite rule like (.*) --> app.php in there, but because it matches a directory it must match "dirname($baseUrl) . '/'".

I also needed to fix one unit test of the getBaseUrl test:
the request uri recently was "/foo%20bar".
but from the $_SERVER infos "foo bar" is a directory, see:
```
'SCRIPT_FILENAME' => '/home/John Doe/public_html/foo bar/app.php',
'SCRIPT_NAME' => '/foo bar/app.php',
'PHP_SELF' => '/foo bar/app.php',
```

webservers will redirect a request "http://www.test.com/foo%20bar" to "http://www.test.com/foo%20bar/" when "foo bar" is a directory. checked this for apache 2.x and nginx 1.4.x.

this fix is for symfony master (3.0.x, see #13039).
I also prepared a merge request for actual 2.7 branch, it will also follow in some minutes. (see #13040)

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | this, #13040, #13038, #7329
| License       | MIT

[HttpFoundation] [Request]
* added missing slash to baseUrl-path part check to remove the path, only when it's also a path in the uri
[HttpFoundation] [Tests] [RequestTest]
* fixed and added unittests

This is the symfony 2.3 branch fix for the issue related to #13038 and #13040

Happy christmas!

Commits
-------

3a3ecd3 [HttpFoundation] [Request] fix baseUrl parsing to fix wrong path_info
2015-01-18 14:31:14 +01:00
rkerner 3a3ecd3353 [HttpFoundation] [Request] fix baseUrl parsing to fix wrong path_info 2015-01-18 14:31:11 +01:00
Fabien Potencier 94e8e03eea bug #13250 [Twig][Bridge][TranslationDefaultDomain] add support of named arguments. (aitboudad)
This PR was squashed before being merged into the 2.3 branch (closes #13250).

Discussion
----------

[Twig][Bridge][TranslationDefaultDomain] add support of named arguments.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Fixed tickets  | #10859
| Tests pass?   | yes
| License       | MIT

Commits
-------

02bc23a [Twig][Bridge][TranslationDefaultDomain] add support of named arguments.
2015-01-18 14:05:52 +01:00
Abdellatif Ait boudad 02bc23a735 [Twig][Bridge][TranslationDefaultDomain] add support of named arguments. 2015-01-18 14:05:48 +01:00
Fabien Potencier ec1cae8b14 minor #13431 [Form] Improved exception message if the data class is not found (fabpot)
This PR was merged into the 2.3 branch.

Discussion
----------

[Form] Improved exception message if the data class is not found

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #12359, #12367
| License       | MIT
| Doc PR        | -

Commits
-------

4145836 [Form] Improved exception message if the data class is not found
2015-01-16 22:23:29 +01:00
Fabien Potencier 7fdb07b206 minor #13430 [Yaml] execute cheaper checks before more expensive ones (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

[Yaml] execute cheaper checks before more expensive ones

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

Minor improvements to the checks as suggested by @stof in #13262.

Commits
-------

cd4349d execute cheaper checks before more expensive ones
2015-01-16 17:22:21 +01:00
Fabien Potencier 414583607c [Form] Improved exception message if the data class is not found 2015-01-16 16:35:59 +01:00
Fabien Potencier 56f315495c bug #13332 [Console] ArgvInput and empty tokens (Taluu)
This PR was submitted for the 2.5 branch but it was merged into the 2.3 branch instead (closes #13332).

Discussion
----------

[Console] ArgvInput and empty tokens

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

If an empty token is provided (from automated tools, or on purpose when running a command), the argument getter was not checking the other tokens, as '' == false in php, which is the stop condition of the while loop in this method.

This method should now rely on the count of tokens rather than on the value of the return of `array_shift`

If the fix is removed on the ArgvInput, the test `testGetParameterOptionEqualSign` should fail, as it shows why this fix is needed (last line of its provider `provideGetParameterOptionValues`)

This is relevant on 2.4+, but as 2.4 has stopped expecting bug fixes since july 2014, I based this PR on 2.5+. So this should be merged in 2.5, 2.6, 2.7 and possibly on master. This should also be cherry-pickable on 2.3 (as it is the current LTS)

Commits
-------

afa1e20 Fixes ArgvInput's argument getter with empty tokens
2015-01-16 16:21:58 +01:00
Baptiste Clavié afa1e2079d Fixes ArgvInput's argument getter with empty tokens
If an empty token is provided (from automated tools, or on purpose when
running a command), the argument getter was not checking the other
tokens, as '' == false in php, which is the stop condition of the while
loop in this method.

This method should now rely on the count of tokens rather than the value
of the return of array_shift
2015-01-16 16:21:58 +01:00
Christian Flothmann cd4349df50 execute cheaper checks before more expensive ones 2015-01-16 15:59:09 +01:00
Fabien Potencier b08115bd63 fixed tests 2015-01-16 15:49:28 +01:00
Fabien Potencier 8a870c24a6 bug #13293 [EventDispatcher] Add missing checks to RegisterListenersPass (znerol)
This PR was submitted for the 2.7 branch but it was merged into the 2.3 branch instead (closes #13293).

Discussion
----------

[EventDispatcher] Add missing checks to RegisterListenersPass

* Support services using a parameter for their class name.
* Prevent abstract services as event subscribers.

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

Commits
-------

0a50b63 [EventDispatcher] Add missing checks to RegisterListenersPass
2015-01-16 15:48:26 +01:00
Lorenz Schori 0a50b63da1 [EventDispatcher] Add missing checks to RegisterListenersPass
* Support services using a parameter for their class name.
* Prevent abstract services as event subscribers.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |
2015-01-16 15:48:25 +01:00
Fabien Potencier 689cf99c4e bug #13262 [Yaml] Improve YAML boolean escaping (petert82, larowlan)
This PR was merged into the 2.3 branch.

Discussion
----------

[Yaml] Improve YAML boolean escaping

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

This PR ensures that PHP [values which would be interpreted as booleans][1] in older versions of the YAML spec are escaped with single quotes when dumped by the Dumper.

For example, dumping this:

```php
array(
    'country_code' => 'no',
    'speaks_norwegian' => 'y',
    'heating' => 'on',
)
```

Will produce this YAML:

```yaml
country_code: 'no'
speaks_norwegian: 'y'
heating: 'on'
```

[1]: http://yaml.org/type/bool.html

Commits
-------

8fa056b Inline private 'is quoting required' methods in Escaper
afe827a Merge pull request #2 from larowlan/patch-2
a0ec0fe Add comment as requested
1e0633e Merge pull request #1 from larowlan/patch-1
81a8090 Remove duplicate 'require'
3760e67 [Yaml] Improve YAML boolean escaping
2015-01-16 14:53:48 +01:00
pthompson 8fa056bc95 Inline private 'is quoting required' methods in Escaper 2015-01-16 14:15:13 +01:00
Fabien Potencier 62f3a29dd0 bug #13420 [Debug] fix loading order for legacy classes (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[Debug] fix loading order for legacy classes

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

Looks like declaration order is important.

Commits
-------

cb34789 [Debug] fix loading order for legacy classes
2015-01-16 07:29:20 +01:00
Nicolas Grekas cb347896b2 [Debug] fix loading order for legacy classes 2015-01-15 13:58:08 +01:00
Fabien Potencier 760ad3306f minor #13386 [Debug] add missing conflict dep rules (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[Debug] add missing conflict dep rules

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

Commits
-------

a4be610 [Debug] add missing conflict dep rules
2015-01-13 11:52:51 +01:00
Nicolas Grekas a4be6103d4 [Debug] add missing conflict dep rules 2015-01-13 10:04:07 +01:00
Fabien Potencier cc359a6798 [TwigBundle] allowed SecurityBundle to use the latest versions of FrameworkBundle 2015-01-13 08:01:38 +01:00
Fabien Potencier faf7db1b8a bug #13371 fix missing comma in YamlDumper (garak)
This PR was merged into the 2.3 branch.

Discussion
----------

fix missing comma in YamlDumper

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

The YamlDumper were missing commas between tag attributes.
See https://github.com/rosstuck/TuckConverterBundle/issues/6

Commits
-------

f600d1a fix missing comma in YamlDumper
2015-01-12 17:43:29 +01:00
Fabien Potencier de48c2ed5d bug #13365 [HttpFoundation] Make use of isEmpty() method (xelaris)
This PR was submitted for the 2.7 branch but it was merged into the 2.3 branch instead (closes #13365).

Discussion
----------

[HttpFoundation] Make use of isEmpty() method

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

Commits
-------

fc51d54 [HttpFoundation] Make use of isEmpty() method
2015-01-12 17:40:49 +01:00
Alexander Schwenn fc51d544b5 [HttpFoundation] Make use of isEmpty() method 2015-01-12 17:40:49 +01:00
Massimiliano Arione f600d1a557 fix missing comma in YamlDumper 2015-01-11 18:40:41 +01:00
Fabien Potencier 76de7006d5 bug #13347 [Console] Helper\TableHelper->addRow optimization (boekkooi)
This PR was merged into the 2.3 branch.

Discussion
----------

[Console] Helper\TableHelper->addRow optimization

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

Commits
-------

9ea59ac [Console] Helper\Table->addRow optimization
2015-01-10 18:05:09 +01:00
Fabien Potencier 55b8939183 bug #13346 [PropertyAccessor] Allow null value for a array (2.3) (boekkooi)
This PR was merged into the 2.3 branch.

Discussion
----------

[PropertyAccessor] Allow null value for a array (2.3)

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

Original PR is #12511
A rebase on 2.3 was requested by @fabpot

Commits
-------

9706b09 [PropertyAccessor] Added test to allow null value for a array
2015-01-09 17:16:50 +01:00
Warnar Boekkooi 9ea59ac531 [Console] Helper\Table->addRow optimization 2015-01-09 16:09:18 +01:00
Warnar Boekkooi 9706b090c0 [PropertyAccessor] Added test to allow null value for a array 2015-01-09 15:57:01 +01:00
Fabien Potencier d5e9de2f94 bug #13170 [Form] Set a child type to text if added to the form without a type. (jakzal)
This PR was merged into the 2.3 branch.

Discussion
----------

[Form] Set a child type to text if added to the form without a type.

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

This copies the behaviour of `FormBuilder::create()` to `Form::add()`.

ping @webmozart

Commits
-------

57070a2 [Form] Set a child type to text if added to the form without a type.
2015-01-09 15:25:23 +01:00
Fabien Potencier 425385400d bug #13334 [Yaml] Fixed #10597: Improved Yaml directive parsing (VictoriaQ)
This PR was submitted for the 2.7 branch but it was merged into the 2.3 branch instead (closes #13334).

Discussion
----------

[Yaml] Fixed #10597: Improved Yaml directive parsing

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

There was a problem with the regular expression used to process the YAML directive. The modifier `s` made the regex too greedy, replacing everything but the last line of the YAML. Existing tests using the YAML directive contained only one line, that's why they were passing.

Commits
-------

95d8ce3 [Yaml] Fixed #10597: Improved Yaml directive parsing
2015-01-09 15:23:47 +01:00
victoria 95d8ce3031 [Yaml] Fixed #10597: Improved Yaml directive parsing 2015-01-09 15:23:46 +01:00
Fabien Potencier 1b39930dad bumped Symfony version to 2.3.25 2015-01-07 12:12:24 +01:00
Fabien Potencier 5b2c33be25 updated VERSION for 2.3.24 2015-01-07 11:32:09 +01:00
Fabien Potencier b74037792f update CONTRIBUTORS for 2.3.24 2015-01-07 11:31:01 +01:00
Fabien Potencier 154e442f47 updated CHANGELOG for 2.3.24 2015-01-07 11:21:38 +01:00
Fabien Potencier 21b27c6be9 fixed tests 2015-01-07 11:18:33 +01:00
Fabien Potencier c076ba8a9a bug #13286 [Security] Don't destroy the session on buggy php releases. (derrabus)
This PR was squashed before being merged into the 2.3 branch (closes #13286).

Discussion
----------

[Security] Don't destroy the session on buggy php releases.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #13269, #13283
| License       | MIT
| Doc PR        | none

See #13269 for the discussion. This workaround avoids destroying the old session after login on the migrate strategy when running under a php version that we know to be broken.

Corresponding php bug: https://bugs.php.net/bug.php?id=63379

Commits
-------

5d0b527 [Security] Don't destroy the session on buggy php releases.
2015-01-07 09:13:08 +01:00
Alexander M. Turek 5d0b527dea [Security] Don't destroy the session on buggy php releases. 2015-01-07 09:13:06 +01:00
Fabien Potencier 515a3ed07e minor #13231 [WIP] Made help information of commands more consistent (WouterJ)
This PR was squashed before being merged into the 2.3 branch (closes #13231).

Discussion
----------

[WIP] Made help information of commands more consistent

| Q   | A
| --- | ---
| Test pass | Not yet
| License | MIT
| Fixed tickets | -

Commits
-------

602d687 [WIP] Made help information of commands more consistent
2015-01-06 18:30:00 +01:00
WouterJ 602d687a46 [WIP] Made help information of commands more consistent 2015-01-06 18:29:58 +01:00
Peter Thompson afe827ae9c Merge pull request #2 from larowlan/patch-2
Add comment as requested - see comment for stof
2015-01-06 14:34:58 +01:00
Lee Rowlands a0ec0fe402 Add comment as requested 2015-01-06 19:37:09 +10:00
Peter Thompson 1e0633edfc Merge pull request #1 from larowlan/patch-1
Remove duplicate 'require' for symfony/symfony PR
2015-01-06 10:10:41 +01:00
Lee Rowlands 81a8090dde Remove duplicate 'require' 2015-01-06 14:18:13 +10:00
Fabien Potencier 1201853b55 minor #13272 [2.3] fix failing test (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[2.3] fix failing test

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

Fix failing tests on 2.3 with components=high

Commits
-------

064799a [2.3] fix failing test
2015-01-05 21:55:16 +01:00
Nicolas Grekas 064799a146 [2.3] fix failing test 2015-01-05 20:37:56 +01:00
Fabien Potencier b6dadf4e18 minor #13242 CS: add missing param names to @param annotation (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

CS: add missing param names to @param annotation

| Q             | A
| ------------- | ---
| Fixed tickets |
| License       | MIT

as stated by @stof [here](https://github.com/symfony/symfony/pull/12886#issuecomment-68626732)

Commits
-------

665825b add missing param names to @param annotation
2015-01-05 15:41:15 +01:00
Fabien Potencier f7d489ef61 fixed typo 2015-01-05 15:38:29 +01:00
Fabien Potencier 190d00cb48 minor #13215 Improve the composer root version setting on Travis (stof)
This PR was merged into the 2.3 branch.

Discussion
----------

Improve the composer root version setting on Travis

The previous implementation was setting dev-master in all branches. This was working fine only because the dev-master branch alias was never updated in maintenance branches, and so dev-master was aliased as 2.3.x-dev in the 2.3 branch.

Commits
-------

01f7a3a Improve the composer root version setting on Travis
2015-01-05 15:37:49 +01:00