Commit Graph

7626 Commits

Author SHA1 Message Date
Martin Hasoň 5fe58bffc5 [Locale] fixed tests 2012-12-05 14:13:56 +01:00
Martin Hasoň 500cc3c4d7 [Config] Fixed tests on Windows 2012-12-05 13:56:40 +01:00
Fabien Potencier 04f51ff89e merged branch hason/twigbundle_test (PR #6187)
This PR was merged into the 2.0 branch.

Commits
-------

acf1f86 [TwigBundle] Fixed tests

Discussion
----------

[2.0][2.1][TwigBundle] Fixed tests
2012-12-04 15:15:11 +01:00
Martin Hasoň acf1f86611 [TwigBundle] Fixed tests 2012-12-04 14:39:39 +01:00
Christophe Coevoet ae3d531737 [TwigBundle] Moved the registration of the app global to the environment
This makes the app global variable available also when accessing the Twig
environment directly instead of using the TwigEngine.

Conflicts:
	src/Symfony/Bridge/Twig/CHANGELOG.md
	src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml
	src/Symfony/Bundle/TwigBundle/TwigEngine.php
2012-12-03 14:25:44 +01:00
Fabien Potencier 9be270e13b merged branch Tobion/patch-4 (PR #6175)
This PR was merged into the 2.0 branch.

Commits
-------

eec7885 needs to use simpleContent in xsd to allow empty elements

Discussion
----------

needs to use simpleContent in xsd to allow empty elements
2012-12-03 13:48:05 +01:00
Tobias Schultze eec788571f needs to use simpleContent in xsd to allow empty elements 2012-12-03 13:35:11 +01:00
Fabien Potencier 90e910f5ab merged branch Tobion/patch-2 (PR #6166)
This PR was merged into the 2.0 branch.

Commits
-------

57edf56 removed wrong routing xsd statement `mixed="true"`

Discussion
----------

removed wrong routing xsd statement `mixed="true"`

mixed="true" means that the element could contain both text and other elements, e.g.
`<requirement key="_locale">text <subelement /></requirement>`
But this wrong and such a definition would not even validate against the scheme as the xsd does not define which elements would be expected inside.
2012-12-02 19:02:32 +01:00
Fabien Potencier afdd08b3ef merged branch Tobion/patch-1 (PR #6164)
This PR was merged into the 2.0 branch.

Commits
-------

d5623b4 removed unused attribute from routing.xsd

Discussion
----------

removed unused attribute from routing.xsd
2012-12-02 19:02:05 +01:00
Fabien Potencier 3495fa61ab bumped Symfony version to 2.0.19-DEV 2012-12-02 18:59:42 +01:00
Tobias Schultze 57edf568a2 removed wrong routing xsd statement `mixed="true"`
mixed="true" means that the element could contain both text and other elements, e.g.
`<requirement key="_locale">text <subelement /></requirement>`
But this wrong and such a definition would not even validate against the scheme as the xsd does not define which elements would be expected inside.
2012-12-01 22:40:50 +01:00
Tobias Schultze d5623b46d8 removed unused attribute from routing.xsd 2012-12-01 22:16:05 +01:00
Fabien Potencier cdb3eccd5b updated VERSION for 2.0.19 2012-11-29 12:36:26 +01:00
Fabien Potencier fa0336831c update CONTRIBUTORS for 2.0.19 2012-11-29 12:35:34 +01:00
Fabien Potencier 8e72d4611a updated CHANGELOG for 2.0.19 2012-11-29 12:35:10 +01:00
Fabien Potencier 9ce892cf43 [HttpFoundation] reverted variable rename 2012-11-29 12:31:26 +01:00
Fabien Potencier e5536f0fe1 replaced magic strings by proper constants 2012-11-29 12:23:09 +01:00
Fabien Potencier f5d8cca25d refactored tests for Request 2012-11-29 12:23:09 +01:00
Fabien Potencier 6a3ba52858 fixed the logic in Request::isSecure() (if the information comes from a source that we trust, don't check other ones) 2012-11-29 12:23:09 +01:00
Fabien Potencier 67e12f3ecb added a way to configure the X-Forwarded-XXX header names and a way to disable trusting them 2012-11-29 12:23:09 +01:00
Fabien Potencier b45873a3f6 fixed algorithm used to determine the trusted client IP 2012-11-29 12:23:09 +01:00
Fabien Potencier 254b11062e removed the non-standard Client-IP HTTP header 2012-11-29 12:23:09 +01:00
Fabien Potencier fc89d6b643 [DependencyInjection] fixed composer.json 2012-11-27 09:54:37 +01:00
Fabien Potencier fc7a39ccd4 merged branch bschussek/icu-check-update (PR #6107)
This PR was merged into the 2.0 branch.

Commits
-------

ac77c5b [Form] Updated checks for the ICU version from 4.5+ to 4.7+ due to test failures with ICU 4.6

Discussion
----------

[Form] Updated checks for the ICU version from 4.5+ to 4.7+

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: -
2012-11-25 11:47:37 +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 6831a3d1c5 merged branch sterrien/patch-1 (PR #5842)
This PR was merged into the 2.0 branch.

Commits
-------

2d9a6fc Use Norm Data instead of Data

Discussion
----------

[Form] Use Norm Data instead of App Data

This listener is triggered when normalized data are binded.

We have to use $event->getForm()->getNormData() instead of $event->getForm()->getData().

I have made a new FormType having 'entity' as parent and having a NormTransformer. I encountered a problem in MergeCollectionListener when the request is binded.

My commit fix it.
2012-11-24 12:53:16 +01:00
Fabien Potencier c20efc7c78 fixed CS 2012-11-24 12:10:50 +01:00
Fabien Potencier 5acbddbdd7 merged branch Tobion/patch-8 (PR #6071)
This PR was merged into the 2.0 branch.

Commits
-------

29bfa13 small fix of #5984 when the container param is not set

Discussion
----------

small fix of #5984 when the container param is not set

 this can happen when the config for the router is unset, but this method does not need to depend on routing. reading an unset config would raise an exception.

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

by Tobion at 2012-11-19T20:44:31Z

Ops, I guess it's wrong. Travis will probably confirm this in a moment.
I will correct that.

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

by flojon at 2012-11-20T22:40:07Z

Yeah you changed the logic...

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

by Tobion at 2012-11-21T14:42:48Z

ok it's fixed.
2012-11-24 12:10:27 +01:00
Tobias Schultze 29bfa13ff0 small fix of #5984 when the container param is not set
this can happen when the config for the router is unset, but this method
does not need to depend on routing. reading an unset config would raise an exception.
2012-11-21 15:35:19 +01:00
Fabien Potencier 85be887e59 fixed CS 2012-11-19 21:00:36 +01:00
Fabien Potencier ebd5e9286c merged branch flojon/patch-3 (PR #5984)
This PR was merged into the 2.0 branch.

Commits
-------

64b54dc Use better default ports in urlRedirectAction
64216f2 Add tests for urlRedirectAction

Discussion
----------

Default to current port in urlRedirectAction

I was a bit surprised when I used urlRedirectAction from a non-standard port (8000) it redirected me to port 80. I would argue that the default should be to use the current port instead. This is a simple patch to change that. This should only break in the case someone is relying on the current default to redirect from a non-standard port to the standard port, which should be a really rare case...

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

by Tobion at 2012-11-11T20:29:54Z

The idea is right but the implementation not. Seems this patch is not as "simple" as you said.
When you're on HTTPS and want to redirect to $scheme = HTTP, then it still uses the current HTTPS port which is wrong.

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

by flojon at 2012-11-11T20:36:47Z

Ah, I see the problem. So I guess the correct behavior would be to use the current port if staying with the same scheme or go to standard port if switching scheme. Unless the user has specified a port which will always override...

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

by Tobion at 2012-11-11T20:42:18Z

That would be the best solution that is currently possible but not the best solution that should be possible.
Because if you switch scheme but the other scheme does not use the standard port, it still doesn't work.
Ideally the Request class had an option that allows to define the ports symfony should use for HTTP and HTTPS.
This logic is in RequestContext, but it's not used here.

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

by flojon at 2012-11-11T21:32:55Z

Bummer, I forgot to check if the current port is a standard port...

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

by Tobion at 2012-11-11T21:35:13Z

add some tests

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

by flojon at 2012-11-11T23:28:18Z

Added tests and fixed my previous error

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

by flojon at 2012-11-15T18:25:12Z

@Tobion is there anything else I needed for this?

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

by fabpot at 2012-11-19T12:56:04Z

To be consistent with how we manage HTTP ports elsewhere, I'd rather use the values of the `request_listener.http_port` and `request_listener.https_port`:

```php
        if (null === $httpPort) {
            $httpPort = $this->container->getParameter('request_listener.http_port');
        }

        if (null === $httpsPort) {
            $httpsPort = $this->container->getParameter('request_listener.https_port');
        }
```

This is done in the `security.authentication.retry_entry_point` service and for the `router_listener` listener.

The parameter name is probably not the best one, but that could be changed then in master.

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

by flojon at 2012-11-19T13:49:18Z

@fabpot But then you would need to set that parameter manually right? It wouldn't automatically redirect you to the same port, which was what I wanted to achieve...

Could this be the right order of preference:
If a value was specified in the route use that.
Otherwise use the current port
unless switching scheme then use the parameter value

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

by fabpot at 2012-11-19T13:52:17Z

Your order of preference looks good to me.

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

by flojon at 2012-11-19T19:13:19Z

Man this was more involved than I thought... :)
Changed the logic to use the parameters when not using the current port. Also tried clean up the tests a little bit... Enjoy!
2012-11-19 20:59:22 +01:00
Jonas Flodén 64b54dc587 Use better default ports in urlRedirectAction 2012-11-19 20:08:12 +01:00
Jonas Flodén 64216f25a5 Add tests for urlRedirectAction 2012-11-19 20:04:16 +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
Fabien Potencier bfeb6e78b7 merged branch vicb/security-config (PR #6017)
This PR was merged into the 2.0 branch.

Commits
-------

32dc31e [SecurityBundle] Convert Http method to uppercase in the config

Discussion
----------

[SecurityBundle] Convert Http method to uppercase in the config

This is not striclty required as method names would be converted to uppercase by the matcher after #5988.

However I think it is better to always use uppercase for http method names.

The config UT has also been improved as part of this PR.

This is good to propagate to 2.1 & 2.2 also.
2012-11-19 13:43:56 +01:00
Fabien Potencier c34f7731a0 merged branch bierdok/master (PR #6015)
This PR was submitted for the master branch but it was merged into the 2.0 branch instead (closes #6015).

Commits
-------

f61c019 Update src/Symfony/Component/DomCrawler/Tests/FormTest.php
9b3aaf2 Update src/Symfony/Component/DomCrawler/Form.php

Discussion
----------

FIX: Malformed field path ""

In case we have the name attribute empty.

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

by fabpot at 2012-11-15T06:12:35Z

Can you add a unit test for that case?

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

by bierdok at 2012-11-15T09:21:01Z

Voila.
2012-11-19 13:42:23 +01:00
Benoît Bourgeois e7401a2129 Update src/Symfony/Component/DomCrawler/Tests/FormTest.php 2012-11-19 13:41:38 +01:00
Benoît Bourgeois b0e468f9ba Update src/Symfony/Component/DomCrawler/Form.php 2012-11-19 13:39:22 +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 32dc31eceb [SecurityBundle] Convert Http method to uppercase in the config 2012-11-15 08:13:39 +01:00
Fabien Potencier cb00411fc8 merged branch Jola/comment-fix (PR #5992)
This PR was merged into the 2.0 branch.

Commits
-------

b3a8efd fixed comment. The parent ACL is not accessed in this method.

Discussion
----------

fixed comment. The parent ACL is not accessed in this method.

Just fixed a comment on PermissionGrantingStrategy.
hasSufficientPermissions() is not accessing the parent ACL. That's done in isGranted().
2012-11-13 13:50:22 +01:00
Jörn Lang b3a8efd6cd fixed comment. The parent ACL is not accessed in this method. 2012-11-12 15:01:47 +01:00
Fabien Potencier d060fd4953 merged branch vicb/security (PR #5988)
This PR was merged into the 2.0 branch.

Commits
-------

e12bd12 [HttpFoundation] Make host & methods really case insensitive in the RequestMacther

Discussion
----------

[HttpFoundation] Make host & methods really case insensitive in the Requ...

...estMacther

and backport changes from 2.2

Details:
- does not take case into account when checking the host (the `Request` always returns a lowercase value) to protect against user typo,
- makes the constructor case proof by invoking setters rather than setting properties directly (you could then add un unreachable method i.e; `get`)

Please propagate to 2.1/2.2 if accpeted. Thanks.
2012-11-12 14:56:10 +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
Fabien Potencier 15a5868ab4 [Validator] fixed Ukrainian language code (closes #5972) 2012-11-10 19:51:50 +01:00
Fabien Potencier 48af594929 merged branch pborreli/patch-1 (PR #5957)
This PR was merged into the 2.0 branch.

Commits
-------

235250e Fixed case of php function

Discussion
----------

Fixed case of php function
2012-11-09 13:32:00 +01:00