Commit Graph

16296 Commits

Author SHA1 Message Date
Fabien Potencier d754467d0e minor #11557 Fix incorrect romanian plural translations (moldcraft)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #11557).

Discussion
----------

Fix incorrect romanian plural translations

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

In romanian plural translations was only one or two forms, but is required three, because it throws errors when transchoice has number that is translated to the third form.

Before fix

![staticshot_04-08-2014_11-27-51](https://cloud.githubusercontent.com/assets/1475489/3794833/ff9047c4-1bb2-11e4-8965-61d53803eb7c.png)

After fix

![staticshot_04-08-2014_11-33-18](https://cloud.githubusercontent.com/assets/1475489/3794844/1f8c48ca-1bb3-11e4-8654-69e0f3107e6d.png)

Info about romanian plural forms

![staticshot_04-08-2014_11-39-41](https://cloud.githubusercontent.com/assets/1475489/3794849/3cb03e70-1bb3-11e4-9151-7075ec9c8f4d.png)

Commits
-------

0c6f750 Fix incorrect romanian plural translations
2014-08-04 11:02:02 +02:00
moldcraft 0c6f750c1e Fix incorrect romanian plural translations 2014-08-04 11:02:01 +02:00
Hany el-Kerdany 18e3e6fe20 [DependencyInjection] fixed missing 'factory-class' attribute in XmlDumper output
Symfony\Component\DependencyInjection\Dumper\XmlDumper didn't write 'factory-class' XML attribute for definitions on which setFactoryClass() was called.

This caused the Container[Builder] to throw an exception when the relevant service is being requested/initiated after loading the dumped XML:

`Uncaught Exception Symfony\Component\DependencyInjection\Exception\RuntimeException: "Cannot create service "xxx" from factory method without a factory service or factory class." at /<path>/<to>/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php`

Fixed the problem, and updated the relevant test fixture.
2014-08-04 10:10:46 +03:00
Fabien Potencier 9ac2234eb8 bug #11548 [Component][DomCrawler] fix axes handling in Crawler::filterXPath() (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

[Component][DomCrawler] fix axes handling in Crawler::filterXPath()

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

Due to some limitations in the ``relativize()`` method, it was not possible to use XPath axes other than ``descendant`` or ``descendant-or-self`` in the ``filterXPath()`` method of the ``Crawler`` class. This commit adds support for the ``ancestor``, ``ancestor-or-self``, ``attribute``, ``child``, ``following``, ``following-sibling``, ``parent``, ``preceding``, ``preceding-sibling`` and ``self`` axes.

The only axis missing after this is the ``namespace`` axis. Filtering for namespace nodes returns ``DOMNameSpaceNode`` instances which can't be passed to the ``add()`` method.

Commits
-------

8dc322b fix axes handling in Crawler::filterXPath()
2014-08-03 08:32:28 +02:00
Christian Raue 8504d02c51 fixed whitespace in Twig form template 2014-08-02 16:06:49 +02:00
Christian Flothmann 8dc322be34 fix axes handling in Crawler::filterXPath()
Due to some limitations in the relativize() method, it was not
possible to use XPath axes other than descendant or descendant-or-self
in the filterXPath() method of the Crawler class. This commit adds
support for the ancestor, ancestor-or-self, attribute, child,
following, following-sibling, parent, preceding, preceding-sibling and
self axes.
2014-08-02 10:47:58 +02:00
Fabien Potencier abf2edf81a minor #11483 fix some docblocks (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

fix some docblocks

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

Commits
-------

1775da5 fix some docblocks
2014-08-02 09:53:48 +02:00
Christian Flothmann f143254220 built-in server: exit when docroot does not exist
When the server:run command is run with an invalid document root
directory (for example, when being in the app directory and not
changing the document root to ../web/), the command crashes on Windows
with a 267 exit code. On Linux, the server starts but just publishes
internal server errors.
2014-08-02 09:12:28 +02:00
Christian Flothmann 1775da5925 fix some docblocks 2014-08-02 08:27:27 +02:00
Fabien Potencier cd005e69ff bug #11422 [DependencyInjection] Self-referenced 'service_container' service breaks garbage collection (sun)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #11422).

Discussion
----------

[DependencyInjection] Self-referenced 'service_container' service breaks garbage collection

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

#### Problem
1. `Container::__construct()` sets the `service_container` service ID to a self-reference of `$this`.
1. This breaks PHP garbage collection (as well as `clone`).

#### Background
* As explained in [Reference Counting Basics](http://php.net/manual/en/features.gc.refcounting-basics.php), PHP is not able to destruct and garbage collect variables that contain a reference to itself, because the `refcount` is always > 0.

#### Example Use-Case
A precompiled container that is cloned for multiple tests (because `::compile()` can be slow).

```php
$precompiled = new ContainerBuilder();
// ...
$precompiled->compile();
foreach ($precompiled->getServiceIds() as $id) {
  if ($precompiled->initialized($id)) {
    $precompiled->set($id, null);
  }
}
$precompiled_clean = clone $precompiled;
$precompiled = NULL;
// ...
foreach ($tests as $test) {
  $container = clone $precompiled_clean;
  // Required without this PR:
  $container->set('service_container', $container);
  // ...
}
```

* **Actual result [master]:**
  All references to the original `$precompiled` container are not destructed and cleaned up, because `$precompiled` still references itself, which can cause terribly hard to debug defects due to stale reference pointers in memory (especially with `ContainerAware` services, or things like e.g. PDO connections), as well as high memory consumption, etc.

* **Expected result [PR]:**
  No references to `$precompiled` are left; everything is shut down, cleaned up, and garbage-collected upon `$precompiled = NULL;`

#### Proposed solution
1. Hard-code a special behavior for the service ID `service_container`.
1. Remove the self-reference.
1. For now (until next major release), ensure that all `Container` methods work identically to before — instead of throwing exceptions when e.g. trying to set `service_container` to something that isn't `$this`… (which is technically possible right now, but the operation doesn't remotely make sense)

#### API changes
Per (3) above, this PR is backwards-compatible.  However, for the sake of full disclosure, users may experience the following super-micro changes compared to HEAD:

1. The following method no longer exists in a dumped Container, because it is no longer a registered service:

  ```php
      protected function getServiceContainerService()
      {
          throw new RuntimeException('You have requested a synthetic service ("service_container"). The DIC does not know how to construct this service.');
      }
  ```
  But given the exception, you weren't able to call it anyway.
1. The order/position of `service_container` in the array returned by `Container::getServiceIds()` may be different.

  But that array has no particular order to begin with.

  (Only the component's own unit tests are expecting an identical result at times, which is why I added the hard-coded ID via `$id[]` last, instead of initializing it first with `$id` already.)
1. `$container->set('service_container', $not_the_container);` no longer works.

Commits
-------

440322e Fixed self-reference in 'service_container' service breaks garbage collection (and clone).
2014-08-02 08:06:08 +02:00
sun 440322effc Fixed self-reference in 'service_container' service breaks garbage collection (and clone). 2014-08-02 08:06:01 +02:00
Fabien Potencier 497c875304 minor #11539 [Process] Fix tests when pcntl is not available. (jakzal)
This PR was merged into the 2.3 branch.

Discussion
----------

[Process] Fix tests when pcntl is not available.

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

It's solved the same way in the [AbstractProcessTest](3b837dc5c1/src/Symfony/Component/Process/Tests/AbstractProcessTest.php (L602-L603)).

Commits
-------

e40f24f [Process] Fix tests when pcntl is not available.
2014-08-01 14:08:29 +02:00
Jakub Zalas e40f24f0a9 [Process] Fix tests when pcntl is not available. 2014-08-01 11:51:55 +01:00
Fabien Potencier a292a489c5 minor #11537 Make builds green again (jakzal)
This PR was merged into the 2.3 branch.

Discussion
----------

Make builds green again

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

This PR rolls back changes made to the fixture and generated files in e9022adaef (#11512).

Commits
-------

88b4e70 [DependencyInjection] Roll back changes made to generated files.
f89811d [Console] Roll back changes made to fixture files.
2014-08-01 08:16:34 +02:00
Fabien Potencier 73ddf39ffc bug #11428 [Serializer] properly handle null data when denormalizing (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

[Serializer] properly handle null data when denormalizing

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

Commits
-------

123fc62 properly handle null data when denormalizing
2014-08-01 08:14:57 +02:00
Jakub Zalas 88b4e7008d [DependencyInjection] Roll back changes made to generated files.
Original change was made in e9022adaef.
2014-07-31 22:03:37 +01:00
Jakub Zalas f89811d8d1 [Console] Roll back changes made to fixture files.
Original change was made in e9022adaef.
2014-07-31 21:49:10 +01:00
Martin Hasoň c689186674 [WebProfilerBundle] Fixed double height of canvas 2014-07-31 16:08:09 +02:00
Bernhard Schussek 7d7b5c724f bug #10687 [Validator] Fixed string conversion in constraint violations (eagleoneraptor, webmozart)
This PR was merged into the 2.3 branch.

Discussion
----------

[Validator] Fixed string conversion in constraint violations

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

Commits
-------

32ae95b [Validator] Added more detailed inline documentation
08ea6d3 [Validator] Removed information from the violation output if the value is an array, object or resource
d6a783f [Validator] Renamed valueToString() to formatValue(); added missing formatValue() calls
71897d7 [Validator] Fixed CS
cea4155 [Validator] Fixed date-to-string conversion tests to match ICU 51
5aa7e6d [Validator] Added "{{ value }}" parameters where they were missing
f329552 [Validator] Simplified and explained the LuhnValidator
bff09f2 [Validator] Simplified IssnValidator
224e70f [Validator] Fixed and simplified IsbnValidator
fd58870 [Validator] Simplified IBAN validation algorithm
97243bc [Validator] Fixed value-to-string conversion in constraint violations
75e8815 [Validator] Fix constraint violation message parameterization
2014-07-30 14:38:50 +02:00
Bernhard Schussek 32ae95bdda [Validator] Added more detailed inline documentation 2014-07-30 14:36:14 +02:00
Bernhard Schussek 08ea6d3621 [Validator] Removed information from the violation output if the value is an array, object or resource
This was decided in the discussion of #10687.
2014-07-30 14:36:07 +02:00
Yassine Guedidi 777666fac1 [HttpFoundation] Update QUERY_STRING when overrideGlobals 2014-07-30 12:14:11 +02:00
Fabien Potencier 71edf38d59 partially reverted previous commit 2014-07-29 20:14:16 +02:00
Fabien Potencier e9022adaef fixed CS 2014-07-29 20:09:11 +02:00
Fabien Potencier 20bf24ea3d minor #11491 Update validators.eu.xlf (g123456789l)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #11491).

Discussion
----------

Update validators.eu.xlf

Spelling of 'CSRF' was incorrect

Commits
-------

d432395 Update validators.eu.xlf
2014-07-28 11:30:47 +02:00
g123456789l d4323951f2 Update validators.eu.xlf
Spelling of 'CSRF' was incorrect
2014-07-28 11:30:47 +02:00
Fabien Potencier 24cd42555c bug #11475 [EventDispatcher] don't count empty listeners (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

[EventDispatcher] don't count empty listeners

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

When event listeners for certain events are removed from the event
dispatcher, empty arrays are not being removed. Therefore, counting
on empty arrays leads to wrong results of the hasListeners() method.

Thanks to @mlindenb for discovering this an proposing a solution.

Commits
-------

fdbb04a [EventDispatcher] don't count empty listeners
2014-07-27 10:29:33 +02:00
Fabien Potencier ff4a37ff24 minor #11484 remove unused imports (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

remove unused imports

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

Commits
-------

9cd059e remove unused imports
2014-07-27 10:26:10 +02:00
Fabien Potencier 0bce1483c1 fixed CS 2014-07-27 10:25:12 +02:00
Fabien Potencier 8b051f9daa minor #11481 Unify null comparisons (WouterJ)
This PR was merged into the 2.3 branch.

Discussion
----------

Unify null comparisons

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

Commits
-------

be04c50 Unify null comparisons
2014-07-27 09:59:35 +02:00
Christian Flothmann 9cd059ee1f remove unused imports 2014-07-26 20:24:56 +02:00
WouterJ be04c5000c Unify null comparisons 2014-07-26 11:54:23 +02:00
Christian Flothmann fdbb04a6ac [EventDispatcher] don't count empty listeners
When event listeners for certain events are removed from the event
dispatcher, empty arrays are not being removed. Therefore, counting
on empty arrays leads to wrong results of the hasListeners() method.
2014-07-25 17:00:14 +02:00
Romain Neutron c548bd861a bug #11436 fix signal handling in wait() on calls to stop() (xabbuh, romainneutron)
This PR was merged into the 2.3 branch.

Discussion
----------

fix signal handling in wait() on calls to stop()

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

``wait()`` throws an exception when the process was terminated by a signal. This should not happen when the termination was requested by calling the ``stop()`` method (for example, inside a callback which is passed to ``wait()``).

Commits
-------

5939d34 [Process] Fix unit tests in sigchild environment
eb68662 [Process] fix signal handling in wait()
94ffc4f bug #11469  [BrowserKit] Fixed server HTTP_HOST port uri conversion (bcremer, fabpot)
103fd88 [BrowserKit] refactor code and fix unquoted regex
f401ab9 Fixed server HTTP_HOST port uri conversion
045cbc5 bug #11425 Fix issue described in #11421 (Ben, ben-rosio)
f5bfa9b bug #11423 Pass a Scope instance instead of a scope name when cloning a container in the GrahpvizDumper (jakzal)
3177be5 minor #11464 [Translator] Use quote to surround invalid locale (lyrixx)
c9742ef [Translator] Use quote to surround invalid locale
4dbe0e1 bug #11120 [2.3][Process] Reduce I/O load on Windows platform (romainneutron)
797d814 bug #11342 [2.3][Form] Check if IntlDateFormatter constructor returned a valid object before using it (romainneutron)
0b5348e minor #11441 [Translator] Optimize assertLocale regexp (Jérémy Derussé)
537c39b Optimize assertLocale regexp
4cf50e8 Bring code into standard
9f4313c [Process] Add test to verify fix for issue #11421
02eb765 [Process] Fixes issue #11421
6787669 [DependencyInjection] Pass a Scope instance instead of a scope name.
9572918 bug #11411 [Validator] Backported #11410 to 2.3: Object initializers are called only once per object (webmozart)
291cbf9 [Validator] Backported #11410 to 2.3: Object initializers are called only once per object
efab884 bug #11403 [Translator][FrameworkBundle] Added @ to the list of allowed chars in Translator (takeit)
3176f8b [Translator][FrameworkBundle] Added @ to the list of allowed chars in Translator
91e32f8 bug #11381 [2.3] [Process] Use correct test for empty string in UnixPipes (whs, romainneutron)
45df2f3 minor #11397 [2.3][Process] Fix unit tests on Windows platform (romainneutron)
cec0a45 [Process] Adjust PR #11264, make it Windows compatible and fix CS
d418935 [Process] Fix unit tests on Windows platform
ff0bb01 [Process] Reduce I/O load on Windows platform
ace5a29 bumped Symfony version to 2.3.19
75e07e6 updated VERSION for 2.3.18
4a12f4d update CONTRIBUTORS for 2.3.18
98b891d updated CHANGELOG for 2.3.18
06a80fb Validate locales sets intos translator
06fc97e feature #11367 [HttpFoundation] Fix to prevent magic bytes injection in JSONP responses... (CVE-2014-4671) (Andrew Moore)
3c54659 minor #11387 [2.3] [Validator] Fix UserPassword validator translation (redstar504)
73d50ed Fix UserPassword validator translation
93a970c bug #11386 Remove Spaceless Blocks from Twig Form Templates (chrisguitarguy)
8f9ed3e Remove Spaceless Blocks from Twig Form Templates
9e1ea4a [Process] Use correct test for empty string in UnixPipes
6af3d05 [HttpFoundation] Fix to prevent magic bytes injection in JSONP responses (Prevents CVE-2014-4671)
ebf967d [Form] Check if IntlDateFormatter constructor returned a valid object before using it
2014-07-25 11:23:56 +02:00
Romain Neutron 5939d34c17 [Process] Fix unit tests in sigchild environment 2014-07-25 10:39:28 +02:00
Christian Flothmann eb68662360 [Process] fix signal handling in wait()
wait() throws an exception when the process was terminated by a signal.
This should not happen when the termination was requested by calling
either the stop() or the signal() method (for example, inside a callback
which is passed to wait()).
2014-07-25 10:39:21 +02:00
Fabien Potencier 94ffc4fab2 bug #11469 [BrowserKit] Fixed server HTTP_HOST port uri conversion (bcremer, fabpot)
This PR was merged into the 2.3 branch.

Discussion
----------

 [BrowserKit] Fixed server HTTP_HOST port uri conversion

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

See #11356

Commits
-------

103fd88 [BrowserKit] refactor code and fix unquoted regex
f401ab9 Fixed server HTTP_HOST port uri conversion
2014-07-25 08:30:34 +02:00
Fabien Potencier 103fd88b40 [BrowserKit] refactor code and fix unquoted regex 2014-07-25 07:47:26 +02:00
Benjamin Cremer f401ab9032 Fixed server HTTP_HOST port uri conversion 2014-07-25 07:41:17 +02:00
Fabien Potencier 045cbc53cc bug #11425 Fix issue described in #11421 (Ben, ben-rosio)
This PR was merged into the 2.3 branch.

Discussion
----------

Fix issue described in #11421

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

This pull request fixes the issue described in #11421.  It also adds a test for the issue.  The issue is present in 2.0 forward, but I decided to fix it on the 2.3 branch so that I could also write a test for it (2.0 had no tests for the Process component, and 2.1 and 2.2 didn't have tests for the `ExecutableFinder` class).

Commits
-------

4cf50e8 Bring code into standard
9f4313c [Process] Add test to verify fix for issue #11421
02eb765 [Process] Fixes issue #11421
2014-07-25 07:28:54 +02:00
Fabien Potencier f5bfa9bc9e bug #11423 Pass a Scope instance instead of a scope name when cloning a container in the GrahpvizDumper (jakzal)
This PR was merged into the 2.3 branch.

Discussion
----------

Pass a Scope instance instead of a scope name when cloning a container in the GrahpvizDumper

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

Commits
-------

6787669 [DependencyInjection] Pass a Scope instance instead of a scope name.
2014-07-25 07:22:20 +02:00
Christian Flothmann 123fc62652 properly handle null data when denormalizing
If null is passed to denormalize(), no property values can be set on
the denormalized object. Additionally, this fixes passing values to
the denormalized object's constructor if the incoming data is an object.
2014-07-24 20:40:16 +02:00
Fabien Potencier 3177be50f8 minor #11464 [Translator] Use quote to surround invalid locale (lyrixx)
This PR was submitted for the 2.5 branch but it was merged into the 2.3 branch instead (closes #11464).

Discussion
----------

[Translator] Use quote to surround invalid locale

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

I got this message in one application (CLI):

```

  [InvalidArgumentException]
  Invalid locale: en_US .

```

It's not so easy to spot the issue.

Commits
-------

c9742ef [Translator] Use quote to surround invalid locale
2014-07-24 18:59:35 +02:00
Grégoire Pineau c9742efe99 [Translator] Use quote to surround invalid locale 2014-07-24 18:59:28 +02:00
Bernhard Schussek d6a783f989 [Validator] Renamed valueToString() to formatValue(); added missing formatValue() calls 2014-07-24 16:57:54 +02:00
Bernhard Schussek 71897d7e35 [Validator] Fixed CS 2014-07-24 13:57:51 +02:00
Bernhard Schussek cea4155d39 [Validator] Fixed date-to-string conversion tests to match ICU 51 2014-07-24 13:57:51 +02:00
Bernhard Schussek 5aa7e6dbe0 [Validator] Added "{{ value }}" parameters where they were missing 2014-07-24 13:57:51 +02:00
Bernhard Schussek f3295522ef [Validator] Simplified and explained the LuhnValidator 2014-07-24 13:57:51 +02:00
Bernhard Schussek bff09f210b [Validator] Simplified IssnValidator 2014-07-24 13:57:51 +02:00