Commit Graph

15492 Commits

Author SHA1 Message Date
Pierre-Yves LEBECQ 739bf715c7 [DomCrawler] Allowed internal validation of ChoiceFormField to be disabled 2013-10-01 10:36:54 +02:00
Alessandro Tagliapietra f5812c5e40 [Form] Let null values to unset fields in PATCH requests 2013-10-01 10:31:32 +02:00
Fabien Potencier b85b78f24a bug#9183 [Security] Fixed test cases of the Csrf sub-component (bschussek)
This PR was merged into the master branch.

Discussion
----------

[Security] Fixed test cases of the Csrf sub-component

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

Commits
-------

7c7d86e [Security] Fixed test cases of the Csrf sub-component
2013-10-01 10:20:34 +02:00
Bernhard Schussek 7c7d86e369 [Security] Fixed test cases of the Csrf sub-component 2013-10-01 10:18:52 +02:00
Fabien Potencier 2cd6e002c7 feature#8957 [HttpFoundation] added a way to override the Request class (fabpot)
This PR was merged into the master branch.

Discussion
----------

[HttpFoundation] added a way to override the Request class

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #7461, #7453
| License       | MIT
| Doc PR        | symfony/symfony-docs#3021

This is an alternative implementation for #7461.

I've also reverted #7381 and #7390 as these changes are not needed anymore.

Todo:

 - [ ] add some tests

Commits
-------

464439d [HttpFoundation] added a way to override the Request class
2013-10-01 07:05:57 +02:00
Fabien Potencier 464439d195 [HttpFoundation] added a way to override the Request class 2013-09-30 22:35:02 +02:00
Fabien Potencier d80e840b7f [Console] added some tests for previous merge (refs #8626) 2013-09-30 21:59:36 +02:00
Fabien Potencier ad7be73e40 feature#8626 [Console] pass command name automatically if required by the application (xabbuh)
This PR was submitted for the 2.2 branch but it was merged into the master branch instead (closes #8626).

Discussion
----------

[Console] pass command name automatically if required by the application

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

Commits
-------

50c8050 [Console] pass command name automatically if required by the application
2013-09-30 21:44:36 +02:00
Christian Flothmann 81aead238b pass command name automatically if required by the application 2013-09-30 21:44:35 +02:00
Fabien Potencier 426559f65e feature#9119 [HttpFoundation] Add a way to avoid the session be written at each request (adrienbrault)
This PR was merged into the master branch.

Discussion
----------

[HttpFoundation] Add a way to avoid the session be written at each request

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no (maybe the DI config ?)
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/3017

Commits
-------

38f02ea [HttpFoundation] Add a way to avoid the session be written at each request
2013-09-30 21:42:39 +02:00
Adrien Brault 38f02eacbf [HttpFoundation] Add a way to avoid the session be written at each request 2013-09-30 12:03:12 -07:00
Fabien Potencier 1893478dd5 feature#9119 [HttpFoundation] Add a way to avoid the session be written at each request (adrienbrault)
This PR was merged into the master branch.

Discussion
----------

[HttpFoundation] Add a way to avoid the session be written at each request

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no (maybe the DI config ?)
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/3017

Commits
-------

191418d [HttpFoundation] Add a way to avoid the session be written at each request
2013-09-30 19:51:08 +02:00
Adrien Brault 191418d24d [HttpFoundation] Add a way to avoid the session be written at each request 2013-09-30 10:45:51 -07:00
Fabien Potencier c886612c99 fixed some unit tests 2013-09-30 19:16:09 +02:00
Fabien Potencier c741c5838d fixed typos 2013-09-30 17:49:53 +02:00
Fabien Potencier bdcdc6eddb feature#9170 Decoupled TraceableEventDispatcher from the Profiler (fabpot)
This PR was merged into the master branch.

Discussion
----------

Decoupled TraceableEventDispatcher from the Profiler

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

This PR removes the Profiler dependency on the TraceableEventDispatcher. That makes things more decoupled and cleaner. This PR also cleans up how profiles are stored; a Profile is now always stored only once.

I've created a `LateDataCollectorInterface` that is implemented for data collector that needs to get information from data that are available very late in the request process (when the request and the response are not even available anymore). The `lateCollect()` method is called just before the profile is stored.

We have 3 data collectors that implement that interface:

 * Time: As the traceable event dipsatcher gets inject timing information via the stopwatch about all events (including the `terminate` one), we need to get events from the stopwatch as late as possible.
 * Event: The traceable event dispatcher gathers all called listeners to determine non-called ones. To be able to accurately do that for all events (including the `terminate` one), we need to get the data as late as possible.
 * Memory: We want to get the memory as late as possible to get the most accurate number as possible

I'm not very happy with the name and as always, better suggestions would be much appreciated.

This is an extract from #9168

Commits
-------

5cedea2 [HttpKernel] added LateDataCollectorInterface
9c4bc9a [HttpKernel] decoupled TraceableEventDispatcher and Profiler
2013-09-30 17:42:20 +02:00
Fabien Potencier 0f80916313 feature#6554 [Security] Added Security\Csrf sub-component with better token generation (bschussek)
This PR was merged into the master branch.

Discussion
----------

[Security] Added Security\Csrf sub-component with better token generation

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

**Update September 27, 2013**

This PR simplifies the CSRF mechanism to generate completely random tokens. A random token is generated once per ~~intention~~ token ID and then stored in the session. Tokens are valid until the session expires.

Since the CSRF token generator depends on `StringUtils` and `SecureRandom` from Security\Core, and since Security\Http currently depends on the Form component for token generation, I decided to add a new Security\Csrf sub-component that contains the improved CSRF token generator. Consequences:

* Security\Http now depends on Security\Csrf instead of Form
* Form now optionally depends on Security\Csrf
* The configuration for the "security.secure_random" service and the "security.csrf.*" services was moved to FrameworkBundle to guarantee BC

In the new Security\Csrf sub-component, I tried to improve the naming where I could do so without breaking BC:

* CSRF "providers" are now called "token generators"
* CSRF "intentions" are now called "token IDs", because that's really what they are

##### TODO

- [ ] The documentation needs to be checked for references to the configuration of the application secret. Remarks that the secret is used for CSRF protection need to be removed.
- [ ] Add aliases "csrf_token_generator" and "csrf_token_id" for "csrf_provider" and "intention" in the SecurityBundle configuration
- [x] Make sure `SecureRandom` never blocks for `CsrfTokenGenerator`

Commits
-------

7f02304 [Security] Added missing PHPDoc tag
2e04e32 Updated Composer dependencies to require the Security\Csrf component where necessary
bf85e83 [FrameworkBundle][SecurityBundle] Added service configuration for the new Security CSRF sub-component
2048cf6 [Form] Deprecated the CSRF implementation and added an optional dependency to the Security CSRF sub-component instead
85d4959 [Security] Changed Security HTTP sub-component to depend on CSRF sub-component instead of Form
1bf1640 [Security] Added CSRF sub-component
2013-09-30 17:35:08 +02:00
Fabien Potencier 164c1cbfec feature#9171 [Form] Rewrite boolean attributes to match HTML spec (bschussek)
This PR was merged into the master branch.

Discussion
----------

[Form] Rewrite boolean attributes to match HTML spec

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

Same as #7856

> 'The presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value.' - http://www.w3.org/html/wg/drafts/html/master/infrastructure.html#boolean-attribute

This commit modifies widget_container_attributes and widget_attributes so that:

* `true` values render as the attribute name with the attribute name repeated as the value
* `false` values are not rendered

The comparison is strict using sames() in twig.

Previously `false` values would have been rendered as `some-attribute=""` which according to the spec would actually make them a boolean attribute and therefore equal to true.

Commits
-------

b85577b [Form] Improved test coverage of widget_attributes and widget_container_attributes blocks
8e4c2a7 [Form] Rewrite boolean attributes to match HTML spec
2013-09-30 15:57:18 +02:00
Bernhard Schussek 7f02304654 [Security] Added missing PHPDoc tag 2013-09-30 15:41:48 +02:00
Bernhard Schussek 2e04e32c8f Updated Composer dependencies to require the Security\Csrf component where necessary 2013-09-30 14:39:06 +02:00
Bernhard Schussek b85577bb96 [Form] Improved test coverage of widget_attributes and widget_container_attributes blocks 2013-09-30 14:32:22 +02:00
Leevi Graham 8e4c2a7e65 [Form] Rewrite boolean attributes to match HTML spec
'The presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value.'

- http://www.w3.org/html/wg/drafts/html/master/infrastructure.html#boolean-attribute
2013-09-30 14:07:49 +02:00
Fabien Potencier e281d7748e bug#8809 [Form] enforce correct timezone (Burgov)
This PR was merged into the 2.2 branch.

Discussion
----------

[Form] enforce correct timezone

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | not sure if this is a BC break...
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

I'm using the Form component to handle JSON requests which come from AJAX requests. The JSON is formed by the Angular toJson method

A typical request would be:
```
{
  name: "Some name"
  start: "2013-08-21T05:00:00.000Z"
  end: "2013-08-21T15:00:00.000Z"
}
```

Note that in this case, what I entered in my input boxes are 7:00 for start and 17:00 for end times. As you can see, Angular (or Chrome, I'm not sure), converts this to the "Z" timezone. Since I cannot enforce the correct timezone client side, the timezone will differ from the one configured in the DateTimeType, however, instead of resulting in either an error or a conversion to the correct timezone, I get a datetime object in the wrong timezone, eventually resulting in wrong values in the database.

By checking the required output timezone against the actual timezone of the input datetime object, rather than the expected timezone supplied, this problem is solved.

Commits
-------

b0349a1 [Form] check the required output timezone against the actual timezone of the input datetime object, rather than the expected timezone supplied
2013-09-30 12:22:54 +02:00
Fabien Potencier e0d3573454 Revert "merged branch Tobion/flattenexception (PR #9111)"
This reverts commit 53b2048c4c, reversing
changes made to c60a8e962b.
2013-09-30 11:54:26 +02:00
Fabien Potencier 5cedea2c07 [HttpKernel] added LateDataCollectorInterface 2013-09-30 10:54:48 +02:00
Fabien Potencier 9c4bc9a0ed [HttpKernel] decoupled TraceableEventDispatcher and Profiler 2013-09-30 10:52:26 +02:00
Fabien Potencier 59409b47c8 fixed wrong merge 2013-09-29 21:54:28 +02:00
Fabien Potencier d10dec9bf3 Merge branch '2.3'
* 2.3:
  fixed Client when using the terminable event
  Fix problem with Windows file links (backslash in JavaScript string)
  [Security] fixed wrong phpdoc
  [DependencyInjection] Prevented inlining of lazy loaded private service definitions.
  [Routing] removed extra argument
  [HttpFoundation] Header `HTTP_X_FORWARDED_PROTO` can contain various values Some proxies use `ssl` instead of `https`, as well as Lighttpd mod_proxy allows value chaining (`https, http`, where `https` is always first when request is encrypted).
  Added doc comments

Conflicts:
	src/Symfony/Component/Routing/Router.php
	src/Symfony/Component/Security/Http/Firewall.php
2013-09-29 21:43:28 +02:00
Fabien Potencier bc256f9da4 Merge branch '2.2' into 2.3
* 2.2:
  fixed Client when using the terminable event
  Fix problem with Windows file links (backslash in JavaScript string)
  [Security] fixed wrong phpdoc
  [Routing] removed extra argument
  [HttpFoundation] Header `HTTP_X_FORWARDED_PROTO` can contain various values Some proxies use `ssl` instead of `https`, as well as Lighttpd mod_proxy allows value chaining (`https, http`, where `https` is always first when request is encrypted).
  Added doc comments

Conflicts:
	src/Symfony/Component/HttpFoundation/Request.php
2013-09-29 21:41:41 +02:00
Fabien Potencier 66d0b18deb bug#9169 Fixed client insulation when using the terminable event (fabpot)
This PR was merged into the 2.2 branch.

Discussion
----------

Fixed client insulation when using the terminable event

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

8c8cf62 fixed Client when using the terminable event
2013-09-29 21:40:44 +02:00
Fabien Potencier 8c8cf62038 fixed Client when using the terminable event 2013-09-29 21:31:28 +02:00
Fabien Potencier 44b890ee68 fixed a typo 2013-09-29 20:27:12 +02:00
Fabien Potencier 0d3900fbb4 bug#9166 [HttpKernel] added missing argument to listener call (fabpot)
This PR was merged into the master branch.

Discussion
----------

[HttpKernel] added missing argument to listener call

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

When calling a listener, the dispatcher now must pass the event name and the dispatcher (see 7852), but the traceable event dispatcher did not do that.

Commits
-------

e26ae45 [HttpKernel] added missing argument to listener call
2013-09-29 19:44:49 +02:00
Fabien Potencier e26ae45a42 [HttpKernel] added missing argument to listener call 2013-09-29 16:28:25 +02:00
Fabien Potencier a46ff2fc59 bug#9154 Fix problem with Windows file links (backslash in JavaScript string) (fabpot)
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes #9154).

Discussion
----------

Fix problem with Windows file links (backslash in JavaScript string)

This PR was submitted on the symfony/WebProfilerBundle read-only repository and moved automatically to the main Symfony repository (closes symfony/WebProfilerBundle#5).

When you have set php.ini setting xdebug.file_link_format, under Windows this window.location call here isn't escaped properly, so it results in something like:

```HTML
<span class="sf-toolbar-info-method" onclick="window.location='pstorm://open/?url=file://F:\HtDocs\myproject\src\Foo\Core\Controller\PageController.php&amp;line=28';window.event.stopPropagation();return false;">
    pageAction
</span>
```

All backslashes in window.location are treated as escape sequences witch result in an incorrect link:
pstorm://open/?url=file://F:HtDocsmyprojectsrcFooCoreControllerPageController.php&line=28

So clicking this link my IDE (phpStorm) couldn't find that file.

The patch fixes this by escaping the backslashes.

Commits
-------

03c6027 Fix problem with Windows file links (backslash in JavaScript string)
2013-09-27 23:42:26 +02:00
Thomas Schulz 5e2ac93f98 Fix problem with Windows file links (backslash in JavaScript string) 2013-09-27 23:42:26 +02:00
Fabien Potencier a38318b218 bug#9153 [DependencyInjection] Prevented inlining of lazy loaded private service definitions (jakzal)
This PR was merged into the 2.3 branch.

Discussion
----------

[DependencyInjection] Prevented inlining of lazy loaded private service definitions

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

Commits
-------

bb0125b [DependencyInjection] Prevented inlining of lazy loaded private service definitions.
2013-09-27 21:46:26 +02:00
Fabien Potencier 27cc10c660 [Security] fixed wrong phpdoc 2013-09-27 18:31:48 +02:00
Fabien Potencier 331043f421 feature#9150 [Filesystem] introduced new Exception base classes (fabpot)
This PR was merged into the master branch.

Discussion
----------

[Filesystem] introduced new Exception base classes

The Filesystem class now throws a ```FileNotFoundException``` if a file could not be found, rather than an basic ```IOException```. The new exception is still a child of the ```IOException```, this way it doesn' t breack BC.
The ```IOException``` now also takes as the first argument an path to the file of interest, which can be used via the ```getPath()``` method.

The switch to the FilesystemInterface will allow you to have an implementation accessing S3 or Dropbox, etc. and still inject it into a classes, which are requiring the Filesystem.

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ~
| Doc PR        | symfony/symfony-docs#2947

Commits
-------

c2e43d0 [Filesystem] removed getPath() on Exceptions and cleaned up CS and error messages
785080a [Filesystem] introduced new Exception base classes
2013-09-27 18:26:45 +02:00
Fabien Potencier a86b35fd7f feature#9151 [HttpKernel] made the cache key generation configurable for the default HttpCache store (fabpot)
This PR was merged into the master branch.

Discussion
----------

[HttpKernel] made the cache key generation configurable for the default HttpCache store

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

Commits
-------

780b77a [HttpKernel] made the cache key generation configurable for the default HttpCache store
2013-09-27 18:24:27 +02:00
Fabien Potencier 780b77af58 [HttpKernel] made the cache key generation configurable for the default HttpCache store 2013-09-27 17:49:58 +02:00
Fabien Potencier 757efb656e bug#9103 [HttpFoundation] Header `HTTP_X_FORWARDED_PROTO` can contain various values (stloyd)
This PR was merged into the 2.2 branch.

Discussion
----------

[HttpFoundation] Header `HTTP_X_FORWARDED_PROTO` can contain various values

Header `HTTP_X_FORWARDED_PROTO` can contain various values. Some proxies use `ssl` instead of `https`, as well as Lighttpd mod_proxy allows value chaining (`https, http`, where `https` is always first when request is encrypted).

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

Commits
-------

d997443 [HttpFoundation] Header `HTTP_X_FORWARDED_PROTO` can contain various values Some proxies use `ssl` instead of `https`, as well as Lighttpd mod_proxy allows value chaining (`https, http`, where `https` is always first when request is encrypted).
2013-09-27 17:05:15 +02:00
Fabien Potencier 279a686fcf minor#8823 [Security] [2.2] Added doc comments and missing use statement (piotrantosik)
This PR was merged into the 2.2 branch.

Discussion
----------

[Security] [2.2] Added doc comments and missing use statement

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

Commits
-------

7ee39a6 Added doc comments
2013-09-27 17:00:06 +02:00
Fabien Potencier c2e43d0aa4 [Filesystem] removed getPath() on Exceptions and cleaned up CS and error messages 2013-09-27 16:57:51 +02:00
Christian Gartner 785080ab02 [Filesystem] introduced new Exception base classes 2013-09-27 16:40:55 +02:00
Fabien Potencier c817539949 [Process] fixed tests 2013-09-27 16:31:42 +02:00
Fabien Potencier 500ddf3494 feature#8191 [Process] Added ProcessBuilder::setEnvironmentVariables (lyrixx)
This PR was merged into the master branch.

Discussion
----------

[Process] Added ProcessBuilder::setEnvironmentVariables

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

Commits
-------

b46ebf7 [Process] Added ProcessBuilder::addEnvironmentVariables
2013-09-27 16:30:49 +02:00
Fabien Potencier 96c5659028 feature#9148 [PropertyAccessor] Throw exception on nonexistant "index" on read access (fabpot)
This PR was merged into the master branch.

Discussion
----------

[PropertyAccessor] Throw exception on nonexistant "index" on read access

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

See discussion on issue #7881.

Commits
-------

e73742a [PropertyAccess] Throw exception on nonexistant "index" on read access
2013-09-27 16:17:45 +02:00
Stephane Escandell e73742a25d [PropertyAccess] Throw exception on nonexistant "index" on read access 2013-09-27 16:14:57 +02:00
Fabien Potencier 9f35ca5ea1 Merge branch '2.3'
* 2.3:
  bumped Symfony version to 2.3.6
  updated VERSION for 2.3.5
  updated CHANGELOG for 2.3.5
  Set cost type to integer
  bumped Symfony version to 2.2.9
  updated VERSION for 2.2.8
  updated CHANGELOG for 2.2.8
  bumped the version
  fixed typo
  updated VERSION for 2.2.7
  update CONTRIBUTORS for 2.2.7
  updated CHANGELOG for 2.2.7
  bugix: CookieJar returns cookies with domain "domain.com" for domain "foodomain.com"
  fixed HTML5 form attribute handling XPath query
  Removed old way of building icu data.

Conflicts:
	src/Symfony/Component/HttpKernel/Kernel.php
2013-09-27 16:07:49 +02:00