Commit Graph

2354 Commits

Author SHA1 Message Date
Fabien Potencier
922c2015f6 Merge branch '2.0' into 2.1
* 2.0:
  [DependencyInjection] fixed composer.json
  [Form] Updated checks for the ICU version from 4.5+ to 4.7+ due to test failures with ICU 4.6
  fixed CS
  small fix of #5984 when the container param is not set
  fixed CS
  Use better default ports in urlRedirectAction
  Add tests for urlRedirectAction
  Update src/Symfony/Component/DomCrawler/Tests/FormTest.php
  Update src/Symfony/Component/DomCrawler/Form.php
  [Security] remove escape charters from username provided by Digest DigestAuthenticationListener
  [Security] added test extra for digest authentication
  fixed CS
  [Security] Fixed digest authentication
  [Security] Fixed digest authentication
  [SecurityBundle] Convert Http method to uppercase in the config
  Use Norm Data instead of Data

Conflicts:
	src/Symfony/Bridge/Doctrine/Form/EventListener/MergeCollectionListener.php
	src/Symfony/Bundle/FrameworkBundle/Controller/RedirectController.php
	src/Symfony/Component/DependencyInjection/composer.json
2012-11-29 11:32:18 +01:00
Bernhard Schussek
ac77c5b2d8 [Form] Updated checks for the ICU version from 4.5+ to 4.7+ due to test failures with ICU 4.6 2012-11-24 14:53:14 +01:00
Fabien Potencier
54ffd9ebfd merged branch sstok/fix_digest_authentication (PR #5874)
This PR was merged into the 2.0 branch.

Commits
-------

f2cbea3 [Security] remove escape charters from username provided by Digest DigestAuthenticationListener
80f6992 [Security] added test extra for digest authentication
d66b03c fixed CS
694697d [Security] Fixed digest authentication
c067586 [Security] Fixed digest authentication

Discussion
----------

Fix digest authentication

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets:
Todo: -
License of the code: MIT
Documentation PR: -
Replaces: #5485

This adds the missing fixes.

My only concerns is the ```\"``` removing.
```\"``` is only needed for the HTTP transport, but keeping them would require to also store the username with the escapes as well.

---------------------------------------------------------------------------

by fabpot at 2012-10-30T11:25:28Z

The digest authentication mechanism is not that widespread due to its limitation. And the transport is not HTTP, I think we are talking about very few cases.

---------------------------------------------------------------------------

by sstok at 2012-10-30T12:49:14Z

Apache seems to remove (ignore) escape characters.

```c
if (auth_line[0] == '=') {
            auth_line++;
            while (apr_isspace(auth_line[0])) {
                auth_line++;
            }

            vv = 0;
            if (auth_line[0] == '\"') {         /* quoted string */
                auth_line++;
                while (auth_line[0] != '\"' && auth_line[0] != '\0') {
                    if (auth_line[0] == '\\' && auth_line[1] != '\0') {
                        auth_line++;            /* escaped char */
                    }
                    value[vv++] = *auth_line++;
                }
                if (auth_line[0] != '\0') {
                    auth_line++;
                }
            }
            else {                               /* token */
                while (auth_line[0] != ',' && auth_line[0] != '\0'
                       && !apr_isspace(auth_line[0])) {
                    value[vv++] = *auth_line++;
                }
            }
            value[vv] = '\0';
        }
```

But would this change be a BC break for people already using quotes but without a comma and thus they never hit this bug?

The change it self is minimum, just calling ```str_replace('\\\\', '\\', str_replace('\\"', '"', $value))``` when getting the username.

---------------------------------------------------------------------------

by fabpot at 2012-11-13T13:00:12Z

@sstok Doing the same as Apache seems the best option here (just document the BC break).

---------------------------------------------------------------------------

by sstok at 2012-11-15T16:05:00Z

Hopefully I did this correct, but the needed escapes seem correctly removed.
`\"` is changed to `"` `\\` is changed to `\`
`\'` it kept as it is, as this needs no correcting.

@Vincent-Simonin Can you verify please.

---------------------------------------------------------------------------

by Vincent-Simonin at 2012-11-19T09:28:18Z

Authentication didn't work with this configuration :

```
providers:
    in_memory:
        name: in_memory
        users:
            te"st: { password: test, roles: [ 'ROLE_USER' ] }
```

`te"st` was set in authentication form's user field.

(Must we also escape `"` in configuration file ?)

Tests were performed with nginx.

---------------------------------------------------------------------------

by sstok at 2012-11-19T09:33:34Z

Yes. YAML escapes using an duplicate quote, like SQL.

```yaml
providers:
    in_memory:
        name: in_memory
        users:
            "te""st": { password: test, roles: [ 'ROLE_USER' ] }
```
2012-11-19 14:04:22 +01:00
Benoît Bourgeois
e7401a2129 Update src/Symfony/Component/DomCrawler/Tests/FormTest.php 2012-11-19 13:41:38 +01:00
Sebastiaan Stok
f2cbea3b30 [Security] remove escape charters from username provided by Digest DigestAuthenticationListener 2012-11-15 16:54:04 +01:00
Sebastiaan Stok
80f6992a41 [Security] added test extra for digest authentication 2012-11-15 16:42:03 +01:00
Sebastiaan Stok
d66b03c830 fixed CS 2012-11-15 16:42:02 +01:00
Vincent Simonin
694697dd91 [Security] Fixed digest authentication
Digest authentication fail if digest parameters contains `=` character or `, ` string.

* Support escaped characters
2012-11-15 16:42:02 +01:00
Vincent Simonin
c067586368 [Security] Fixed digest authentication
Digest authentication fail if digest parameters contains `=` character or `, ` string.
2012-11-15 16:42:01 +01:00
Victor Berchet
e12bd123be [HttpFoundation] Make host & methods really case insensitive in the RequestMacther
and backport changes from 2.2
2012-11-12 13:39:12 +01:00
Bernhard Schussek
8fb334f7fc [Form] Excluded some tests in NumberToLocalizedStringTransformerTest which fail on ICU 4.4, but work on ICU 4.8 2012-11-08 18:34:46 +01:00
Bernhard Schussek
dc80385070 [Form] Fixed NumberToLocalizedStringTransformer to accept both comma and dot as decimal separator, if possible 2012-11-08 15:53:08 +01:00
Pablo Godel
9aec4c8d04 Show correct class name InputArgument in error message 2012-11-05 14:52:03 -05:00
Pablo Godel
762649f5c3 shows correct class name InputOption in error message 2012-11-03 23:51:02 -04:00
Fabien Potencier
a2a60c194b merged branch helios-ag/patch (PR #5496)
This PR was squashed before being merged into the 2.0 branch (closes #5496).

Commits
-------

9872d26 [HttpFoundation] Fix name sanitization after perfoming move

Discussion
----------

[HttpFoundation] Fix name sanitization after perfoming move

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2577
License of the code: MIT

Further work on #2577, fixes name sanitization, after moving file name with new name with non latin characters in the beginning.

---------------------------------------------------------------------------

by stloyd at 2012-09-12T09:52:05Z

You must revert chmod changes.

---------------------------------------------------------------------------

by helios-ag at 2012-09-12T14:30:36Z

@stloyd fixed

---------------------------------------------------------------------------

by stof at 2012-10-13T21:12:43Z

@fabpot what is the status of this PR ?
2012-10-27 21:28:00 +02:00
Al Ganiev
9872d26c9c [HttpFoundation] Fix name sanitization after perfoming move 2012-10-27 21:28:00 +02:00
Fabien Potencier
649872be85 merged branch jonathaningram/issue_5375 (PR #5376)
This PR was merged into the 2.0 branch.

Commits
-------

a094f7e Add check to Store::unlock to ensure file exists

Discussion
----------

[2.0] [HttpKernel] Add check to Store::unlock to ensure file exists

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes

I was seeing this error in my logs when using an `AppCache`:

```
Error 2: /var/www/beta.example.com/shared/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/Store.php line 92: unlink(/var/www/beta.example.com/releases/20120827020525/app/cache/beta/http_cache/md/c2/88/66a911b5266a57bdd55131a47895b8861dfd.lck): No such file or directory
```

It was only occurring when the `http_cache` file was being primed (i.e. first load).

I've added a simple check to ensure that the file is a valid file before trying to unlink. I also added a missing `@return` docblock. Note: I've chosen to return `false` if the file does not exist as this seems to be the behaviour of the `purge` method.

---------------------------------------------------------------------------

by jonathaningram at 2012-08-29T06:46:52Z

@henrikbjorn done and rebased. Thanks.

---------------------------------------------------------------------------

by jonathaningram at 2012-09-17T22:38:47Z

@henrikbjorn any news on this one? It's currently not possible to use the HTTP Cache without the first request failing.

---------------------------------------------------------------------------

by jonathaningram at 2012-09-25T01:28:38Z

ping @fabpot sorry to keep pushing this, but any chance you could take a look at this?
2012-10-27 18:34:13 +02:00
Fabien Potencier
6f15c4780f [ClassLoader] fixed unbracketed namespaces (closes #5747) 2012-10-27 17:55:46 +02:00
Fabien Potencier
4250c033d0 updated vendors for 2.0.18 2012-10-25 10:54:02 +02:00
Bernhard Schussek
bf3e358697 [Form] Fixed creation of multiple money fields with different currencies 2012-10-18 19:17:20 +02:00
Leonid Terentyev
b439d13a81 fixed DomCrwaler/Form to handle <button> when submitted 2012-10-08 14:13:27 +03:00
Keri Henare
6c59fbdb59 [HttpFoundation] Fixed #5611 - Request::splitHttpAcceptHeader incorrect result order.
* Makes items with equal q-values return in the original provided order.
* Fixes tests to reflect this behavior
2012-10-03 09:31:34 +13:00
Benjamin Grandfond
1a53b121aa [2.0][http-foundation] Fix Response::getDate method 2012-09-30 16:03:57 +02:00
Jonathan Ingram
a094f7e2a5 Add check to Store::unlock to ensure file exists
Fix indentation and shorten code
2012-08-29 16:45:40 +10:00
Fabien Potencier
4e0c99211d prevents injection of malicious doc types 2012-08-28 08:43:14 +02:00
Fabien Potencier
c896d71594 refined previous commit 2012-08-28 08:43:14 +02:00
Johannes M. Schmitt
a2a6cdca8d prevents injection of malicious doc types 2012-08-28 08:43:14 +02:00
Fabien Potencier
5cc43f9486 fixed merge 2012-08-27 21:31:24 +02:00
Fabien Potencier
c29edb5e2e merged 2.0 2012-08-26 11:32:04 +02:00
Fabien Potencier
9a355e995a [HttpKernel] excluded a test on PHP 5.3.16, which is buggy (PHP, not Symfony ;)) 2012-08-26 11:23:03 +02:00
Fabien Potencier
04c46ebd33 merged branch bdmu/ticket_5343 (PR #5344)
Commits
-------

f694615 [Process] fix ProcessTest::testProcessPipes hangs on Windows on branch 2.0

Discussion
----------

[Process] fix ProcessTest::testProcessPipes hangs on Windows on branch 2.0

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #5343
Todo: -
License of the code: MIT
Documentation PR:
Marked the test as skipped on Windows, exactly as it is done on master branch (kind of backport)

---------------------------------------------------------------------------

by pborreli at 2012-08-25T20:06:58Z

👍
2012-08-26 11:09:43 +02:00
Christophe L
f694615bc5 [Process] fix ProcessTest::testProcessPipes hangs on Windows on branch 2.0 2012-08-25 23:29:32 +04:00
Christophe L
9beffff263 [HttpKernel] KernelTest::testGetRootDir fails on Windows for branch 2.0 2012-08-25 22:46:45 +04:00
Fabien Potencier
ee572b34cf merged branch hidenorigoto/fix-di-phpdumper (PR #5194)
Commits
-------

1a4a4ee [DependencyInjection] Fixed a frozen constructor of a container with no parameters
2a124bc [DependencyInjection] Added a test for a frozen constructor of a container with no parameters

Discussion
----------

[DependencyInjection] Fix PHP Dumper for a constructor of a frozen container with no parameters

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets:
Todo: -
License of the code: MIT

---------------------------------------------------------------------------

by travisbot at 2012-08-06T16:51:20Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/2049206) (merged 1a4a4ee9 into 3d32a0bc).
2012-08-10 12:39:41 +02:00
Kris Wallsmith
c51fc105f4 avoid fatal error on invalid session 2012-08-07 14:21:04 -04:00
hidenorigoto
2a124bc89c [DependencyInjection] Added a test for a frozen constructor of a container with no parameters 2012-08-07 01:03:17 +09:00
Fabien Potencier
c99f9d29cd fixed merge 2012-08-04 12:08:20 +02:00
Fabien Potencier
7a5f614240 merged 2.0 2012-08-03 11:11:11 +02:00
Victor Berchet
a0709fc365 [DoctrineBridge] Fix log of non utf8 data 2012-08-01 13:10:42 +02:00
Bernhard Schussek
9f4178b672 [Validator] Fixed: StaticMethodLoader does not try to invoke methods of interfaces anymore 2012-07-26 16:39:18 +02:00
Bernhard Schussek
2a3235ac22 [Validator] Fixed group sequence support in the XML and YAML drivers 2012-07-25 17:27:01 +02:00
Victor Berchet
ed8823c168 [HttpFoundation] Allow setting an unknown status code without specifying a text 2012-07-19 17:48:12 +02:00
Hugo Hamon
e9d799ce2c [Routing] fixed ApacheUrlMatcher and ApachMatcherDumper classes that did not take care of default parameters in urls. 2012-07-13 10:17:40 +02:00
Bernhard Schussek
854daa8f83 [Form] Fixed errors not to be added onto non-synchronized forms 2012-07-10 10:03:06 +02:00
Fabien Potencier
facbcdcf45 [Validator] fixed error message for dates like 2012-02-31 (closes #4223) 2012-07-09 17:53:53 +02:00
Fabien Potencier
03d22b74ec fixed CS (mainly method signatures) 2012-07-09 14:43:50 +02:00
Eriksen Costa
28f002d978 [Locale] fixed bug on the parsing of TYPE_INT64 integers in 32 bit and 64 bit environments, caused by PHP bug fix :) (closes #4718) 2012-07-08 22:15:42 -03:00
Fabien Potencier
9572e9bd6e merged branch eriksencosta/issue-3841 (PR #4601)
Commits
-------

a609d55 [Locale] fixed StubIntlDateFormatter to behave like the ext/intl implementation

Discussion
----------

[2.0][WIP][Locale] StubIntlDateFormatter should use the TZ environment variable instead of the PHP's date.timezone setting

Bug fix: yes
Feature addition: no
Backwards compatibility break: yes
Symfony2 tests pass: yes
Fixes the following tickets: #3841
Todo: Check ext/intl changes for the next PHP 5.4 release
License of the code: MIT

![Build Status](https://secure.travis-ci.org/eriksencosta/symfony.png?branch=issue-3841)

There were changes that need to be investigated for the next PHP 5.4 release:

 - [php-src @ eb346ef](eb346ef0f4)
 - [php-src @ 888e77f](888e77ff73)

A strong evidence of bug in ext/intl was found while testing `StubIntlDateFormatter`. See the comment available at the docblock of `StubIntlDateFormatterTest`'s `testFormatWithDefaultTimezoneIntlShouldUseTheTzEnvironmentVariableWhenAvailable()` method and the following Gist for test scripts: https://gist.github.com/2946342

Maybe the upcoming PHP 5.4 release fix this bug since it will use the PHP's `date.timezone` when no time zone is provided. If confirmed the bug, it will need to be reported to the ext/intl maintainers.

---------------------------------------------------------------------------

by travisbot at 2012-06-18T05:02:05Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1644431) (merged a609d55c into cd0aa378).

---------------------------------------------------------------------------

by fabpot at 2012-06-28T14:09:08Z

@eriksencosta Now that PHP 5.4.4 is out, our tests for the Locale components are broken. Is this PR ready to be merged?

---------------------------------------------------------------------------

by eriksencosta at 2012-06-28T14:53:14Z

@fabpot the failed test case seems unrelated to this issue. I will debug it.

Failed test: `Locale\Tests\Stub\StubNumberFormatterTest::testParseTypeInt64IntlWith32BitIntegerInPhp32Bit`

Recent build job: http://travis-ci.org/#!/symfony/symfony/jobs/1729618

I just need to confirm mine todo note. If you want, merge it, I'll track this and make a new PR if needed (possibly only to remove the TODO note.)
2012-06-28 16:57:13 +02:00
Victor Berchet
680b83c6d3 [Security] Allow "0" as a password 2012-06-20 20:42:55 +02:00
Eriksen Costa
a609d55c1f [Locale] fixed StubIntlDateFormatter to behave like the ext/intl implementation 2012-06-18 01:41:22 -03:00