Commit Graph

14109 Commits

Author SHA1 Message Date
Fabien Potencier
0080399b7d bug #9308 [DoctrineBridge] Loosened CollectionToArrayTransformer::transform() to accept arrays (bschussek)
This PR was merged into the 2.2 branch.

Discussion
----------

[DoctrineBridge] Loosened CollectionToArrayTransformer::transform() to accept arrays

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

Previously, writing an association getter like this was impossible:

```php
public function addTag(Tag $tag) { ... }
public function removeTag(Tag $tag) { ... }

public function getTags()
{
    return $this->tags->toArray();
}
```

Using `toArray()` is a useful way to restrict modifications of the collection to the specified methods. But previously, CollectionToArrayTransformer failed in this case, because it did not accept arrays as input.

Commits
-------

55001ab [DoctrineBridge] Loosened CollectionToArrayTransformer::transform() to accept arrays
2013-10-16 16:55:16 +02:00
Fabien Potencier
3e684b4d4f minor #9304 Dead code v2.2 (hhamon)
This PR was merged into the 2.2 branch.

Discussion
----------

Dead code v2.2

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

Commits
-------

0946be6 Removed unused use statements.
2013-10-16 16:51:43 +02:00
Bernhard Schussek
55001abd1a [DoctrineBridge] Loosened CollectionToArrayTransformer::transform() to accept arrays 2013-10-16 16:40:09 +02:00
Hugo Hamon
0946be6c5b Removed unused use statements. 2013-10-16 14:19:20 +02:00
Fabien Potencier
729b41f7af minor #9276 [Stopwatch] Fix tests on Travis (also vagrant) (brikou)
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes #9276).

Discussion
----------

[Stopwatch] Fix tests on Travis (also vagrant)

Travis often fails to run tests related to the Stopwatch Component, check it yourself:

- https://travis-ci.org/symfony/symfony/jobs/12340378
- https://travis-ci.org/symfony/symfony/jobs/12365787
- https://travis-ci.org/symfony/symfony/jobs/12365790
- https://travis-ci.org/symfony/symfony/jobs/12367771
- https://travis-ci.org/symfony/symfony/jobs/12367844
- https://travis-ci.org/symfony/symfony/jobs/12368619
- https://travis-ci.org/symfony/symfony/jobs/12371316
- https://travis-ci.org/symfony/symfony/jobs/12375730

This is because Travis is just slow as hell. So I just multiply the used usleep by 10.

Commits
-------

bf65483 Make usleep longer and simplify assertions
2013-10-15 18:59:36 +02:00
Brikou Carré
beae3b1a8b Make usleep longer and simplify assertions 2013-10-15 18:59:35 +02:00
Fabien Potencier
879305e104 minor #9283 [Security] Added japanese translation resource for security component. (hidenorigoto)
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes #9283).

Discussion
----------

[Security] Added japanese translation resource for security component.

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

Commits
-------

4176cf1 Added japanese translation resource for security component.
2013-10-15 18:57:17 +02:00
hidenorigoto
26e50fff97 Added japanese translation resource for security component. 2013-10-15 18:57:17 +02:00
Fabien Potencier
b599598bb3 bug #9274 [Yaml] Fixed the escaping of strings starting with a dash when dumping (stof)
This PR was merged into the 2.2 branch.

Discussion
----------

[Yaml] Fixed the escaping of strings starting with a dash when dumping

Dashes need to be escaped in character sets in regexes as they are used to specify a range otherwise.
It fixes the dumper bug reported in #9039 (the parsing issue is not fix here)

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

Commits
-------

af369ae [Yaml] Fixed the escaping of strings starting with a dash when dumping
2013-10-11 06:56:07 +02:00
Christophe Coevoet
af369aee64 [Yaml] Fixed the escaping of strings starting with a dash when dumping
Dashes need to be escaped in character sets in regexes as they are used to
specify a range otherwise.
Refs #9039
2013-10-11 00:23:27 +02:00
Fabien Potencier
9f8867376f bug #9270 [Templating] Fix in ChainLoader.php (janschoenherr)
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes #9270).

Discussion
----------

[Templating] Fix in ChainLoader.php

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

The LoaderInterface requires the _time_ parameter to be passed.

Commits
-------

2631eb3 [Templating] Fix in ChainLoader.php
2013-10-10 17:51:38 +02:00
janschoenherr
e2ecc0fd23 Fix in ChainLoader.php
The LoaderInterface requires the time to be passed.
2013-10-10 17:51:38 +02:00
Fabien Potencier
1028c219b7 bug #9246 [Session] fixed wrong started state (tecbot)
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes #9246).

Discussion
----------

[Session] fixed wrong started state

Currently the session stays in the started mode after the call of  ```save()``` which will close the session. We found the issue in our custom SAPI which keeps the symfony stack initialized over multiple requests.

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

Commits
-------

d641cd6 [Session] fixed wrong started states
2013-10-10 17:50:53 +02:00
Thomas Adam
e8d3ab22b4 fixed wrong started states 2013-10-10 17:50:52 +02:00
Fabien Potencier
2996c6b4c6 bumped Symfony version to 2.2.10 2013-10-10 15:10:05 +02:00
Fabien Potencier
6a5c6c0d76 updated VERSION for 2.2.9 2013-10-10 14:15:43 +02:00
Fabien Potencier
cce717011e update CONTRIBUTORS for 2.2.9 2013-10-10 14:15:32 +02:00
Fabien Potencier
9488c489c3 updated CHANGELOG for 2.2.9 2013-10-10 14:07:53 +02:00
Fabien Potencier
67d4a8f8af [Security] limited the password length passed to encoders 2013-10-10 14:05:52 +02:00
Fabien Potencier
0375dc8f9f bug #9237 [FrameworkBundle] assets:install command should mirror .dotfiles (.htaccess) (FineWolf)
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes #9237).

Discussion
----------

[FrameworkBundle] assets:install command should mirror .dotfiles (.htaccess)

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

The `assets:install` command currently ignores all *.dotfiles* when mirroring the `Resources\public` folders of bundles. This can lead to issues when *.htaccess* files are required for some public assets (ie.: CORS headers for font files to be served via Cloudfront).

Since the assets being installed are clearly in a folder called `public`, we can safely assume that those files are in fact supposed to be accessible and copy them over with the normal files.

Commits
-------

9c884a0 [FrameworkBundle] assets:install command should mirror .dotfiles (.htaccess)
2013-10-09 23:05:14 +02:00
Andrew Moore
6f48f8e231 assets:install command should mirror .dotfiles (.htaccess) 2013-10-09 23:05:14 +02:00
Fabien Potencier
2ae07b5fb1 bug #9223 [Translator] PoFileDumper - PO headers (Padam87)
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes #9223).

Discussion
----------

[Translator] PoFileDumper - PO headers

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

Po files should not be dumped without a header. It causes a lot of problems, including charset issues.

See #6765 / 1 for more info

Commits
-------

e93bc50 [Translator] PoFileDumper - PO headers
2013-10-09 22:59:37 +02:00
Adam Prager
a8bc8fff74 PoFileDumper - PO headers 2013-10-09 22:59:37 +02:00
Fabien Potencier
773932b64b removed whitespaces 2013-10-09 22:52:58 +02:00
Fabien Potencier
46e70ea6e8 bug #9257 [Process][2.2] Fix 9182 : random failure on pipes tests (romainneutron)
This PR was merged into the 2.2 branch.

Discussion
----------

[Process][2.2] Fix 9182 : random failure on pipes tests

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

I'm not a big fan of this fix, but - at least - it works.

With this code, finally, Process does not behave the same at all on Windows and Linux.
This patch does not smells very good but it solves the random failing test issue (that produced at runtime too).

Actually, calling `proc_get_status` within the waiting loop introduced the bug.
So this PR reverts to the previous behavior (consider a process running as long as pipes give data). On Windows, this is not the same behavior as we're not using streams but file handles. Whereas the feof of a stream is detected when the other side closes, the feof of a file handle can be reached at any time. So, on Windows, `proc_get_status` is called (checking the feof of the file handle might be positive until the executable outputs something), and we consider a process running as long as the information returned says it's running.

We could think of decouple windows and linux logic in two separated objects, using the interfaces I introduced in #8753. This could bring much more readability and make the code more easy to understand.

Commits
-------

64a0b40 [Process] Fix #9182 : random failure on pipes tests
2013-10-09 22:48:03 +02:00
Romain Neutron
64a0b40e6f [Process] Fix #9182 : random failure on pipes tests 2013-10-09 18:53:02 +02:00
Fabien Potencier
6659d7d9df bug #9222 [Bridge] [Propel1] Fixed guessed relations (ClementGautier)
This PR was merged into the 2.2 branch.

Discussion
----------

[Bridge] [Propel1] Fixed guessed relations

<table>
  <tr><th>Q</th><th>A</th></tr>
  <tr><td>Bug fix</td><td>yes</td></tr>
  <tr><td>Feature addition</td><td>no</td></tr>
  <tr><td>Backwards compatibility break</td><td>no</td></tr>
  <tr><td>Symfony2 tests pass</td><td>yes</td></tr>
  <tr><td>Fixes the following tickets</td><td>N/A</td></tr>
  <tr><td>Todo</td><td>N/A</td></tr>
  <tr><td>License of the code</td><td>MIT</td></tr>
  <tr><td>Documentation PR</td><td>N/A</td></tr>
</table>

The `PropelTypeGuesser` did not match OneToMany relations properly. For example if you have a `Author` class with `Comments` attributes the guesser would guess "Comment" instead of "Comments".

I added some tests to ensure the non regression.

Commits
-------

0b1e95f Fixed propel guessed relations
2013-10-07 11:38:21 +02:00
Clément Gautier
0b1e95f84c Fixed propel guessed relations 2013-10-06 13:10:32 +02:00
Fabien Potencier
e410b1f311 bug #9214 [FramworkBundle] Check event listener services are not abstract (lyrixx)
This PR was merged into the 2.2 branch.

Discussion
----------

[FramworkBundle] Check event listener services are not abstract

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

Commits
-------

6744ead [FramworkBundle][HttpKernel] Check event listener services are not abstract
2013-10-04 16:07:27 +02:00
Grégoire Pineau
6744ead017 [FramworkBundle][HttpKernel] Check event listener services are not abstract 2013-10-04 15:20:41 +02:00
Fabien Potencier
6fce9d8391 fixed CS 2013-10-04 10:27:42 +02:00
Fabien Potencier
83fc73eef0 bug #9207 [HttpKernel] Check for lock existence before unlinking (ollietb)
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes #9207).

Discussion
----------

[HttpKernel] Check for lock existence before unlinking

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

My logs are filled with a bazillion errors stating "Warning: unlink(/var/www/mysite/app/cache/prod/http_cache/md/cf/47/c693da5dab3eccb65fa36a9b4b07ad0f7cc4.lck): No such file or directory in /var/www/mysite/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/Store.php line 53"

Commits
-------

89cd3b9 Check for lock existence before unlinking
2013-10-04 10:27:20 +02:00
Ollie Harridge
8fc64439ca Check for lock existence before unlinking
My logs are filled with a bazillion errors stating "Warning: unlink(/var/www/mysite/app/cache/prod/http_cache/md/cf/47/c693da5dab3eccb65fa36a9b4b07ad0f7cc4.lck): No such file or directory in /var/www/mysite/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/Store.php line 53"
2013-10-04 10:27:20 +02:00
Fabien Potencier
a878e68266 bug #9184 Fixed cache warmup of paths which contain back-slashes (fabpot)
This PR was merged into the 2.2 branch.

Discussion
----------

Fixed cache warmup of paths which contain back-slashes

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

From #8781

"
At this step in the warmup process there is a string replacement made, but paths with backslashes
are written into the cache file as something like `C:\\path\\to\\cache/pro_/...` but the str_replace
searches for the plain string `C:\path\to\cache/pro_/...`, which produces no matches.

The fix solves this by using var_export to escape the search (and replace) paths so they match the
format originally output into the cache file.
"

Commits
-------

526d285 [FrameworkBundle] fixed path replacement on Windows
2013-10-02 12:55:44 +02:00
Fabien Potencier
6180af2304 bug #9192 [2.2][Form] remove MinCount and MaxCount constraints in ValidatorTypeGuesser (franek)
This PR was merged into the 2.2 branch.

Discussion
----------

[2.2][Form] remove MinCount and MaxCount constraints in ValidatorTypeGuesser

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

MinCount and MaxCount has been removed and replaced by Count (in 2.2 also).

Commits
-------

58a3296 remove MinCount and MaxCount contraints. It has been replaced by Count constraints.
2013-10-01 19:10:01 +02:00
franek
58a3296e36 remove MinCount and MaxCount contraints. It has been replaced by Count constraints. 2013-10-01 16:29:34 +02:00
Fabien Potencier
ffe2fb9993 bug #9190 Fix: duplicate usage of Symfony\Component\HttpFoundation\Response (realsim)
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes #9190).

Discussion
----------

Fix: duplicate usage of Symfony\Component\HttpFoundation\Response

Duplicate usage of Symfony\Component\HttpFoundation\Response causes an error:
> PHP Fatal error:  Cannot use Symfony\Component\HttpFoundation\Response as Response because the name is already in use in src/Symfony/Component/Security/Http/Authorization/AccessDeniedHandlerInterface.php on line 17

Commits
-------

e602c09 Fix: duplicate usage of Symfony\Component\HttpFoundation\Response
2013-10-01 16:15:08 +02:00
simpson
70cbfc3180 Fix: duplicate usage of Symfony\Component\HttpFoundation\Response 2013-10-01 16:15:07 +02:00
Fabien Potencier
a2d6419762 bug #9188 [2.2][Form] add support for Length and Range constraint in ValidatorTypeGuesser (franek)
This PR was merged into the 2.2 branch.

Discussion
----------

[2.2][Form] add support for Length and Range constraint in ValidatorTypeGuesser

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

MaxLength, MinLength, Min and Max constraints are deprecated on 2.2. Will be removed in 2.3.

Add support for type guessing of Length and Range constraints.

fix #9132 on 2.2 branch

Commits
-------

89a0404 [Form] add support for Length and Range constraint in order to replace MaxLength, MinLength, Max and Min constraints in next release (2.3)
2013-10-01 14:45:50 +02:00
franek
89a040434e [Form] add support for Length and Range constraint in order to replace MaxLength, MinLength, Max and Min constraints in next release (2.3) 2013-10-01 14:21:02 +02:00
Fabien Potencier
526d2858f2 [FrameworkBundle] fixed path replacement on Windows
In the cache, blackslashes in paths can be both represented by a single
or a double backslash.
2013-10-01 11:24:08 +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
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
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
27cc10c660 [Security] fixed wrong phpdoc 2013-09-27 18:31:48 +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
54e2abd2ce [Routing] removed extra argument 2013-09-26 21:07:06 +02:00