Commit Graph

7112 Commits

Author SHA1 Message Date
Christophe Coevoet
8e13095e5c Fixed the unescaping of parameters to handle arrays 2012-02-02 18:34:11 +01:00
Christophe Coevoet
045f936038 Changed the testcase to expect the unescaping only after the resolution
String values are not unescaped either in resolveValue() because it can
be called several times for the same parameter.
2012-02-02 18:34:05 +01:00
lsmith77
a1b6d4c46b Added a failing testcase for escaped % in array parameters 2012-02-02 18:33:55 +01:00
Fabien Potencier
9fa3201c11 removed unneeded code 2012-02-02 10:00:42 +01:00
Fabien Potencier
048fc2f6b9 merged branch ManuelKiessling/ticket_3124 (PR #3188)
Commits
-------

6090dee [FormType] Adopted MoneyTypeTest::testMoneyPatternWorksForYen to CS
e814d27 [FormType] Fixed broken MoneyType regexp for JPY

Discussion
----------

[Bugfix][Form] Fixed broken MoneyType regexp for JPY

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: ![Build Status](https://secure.travis-ci.org/ManuelKiessling/symfony.png?branch=ticket_3124) Fixes the following tickets: #3124
Todo: -

The regexp in MoneyType doesn't work if currency format has no decimal
(like JPY) and doesn't work either if the currency symbol is unicode

This change fixes both issues and adds a unit test
2012-02-02 09:59:01 +01:00
Fabien Potencier
47598c6d94 merged branch beberlei/Doctrine2.2Compatibilty (PR #3202)
Commits
-------

c3f0ec7 Make DoctrineBundle fowards compatible with Doctrine 2.2

Discussion
----------

[DoctrineBundle] Doctrine 2.2 compatibilty

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

Doctrine 2.2 does not initialize reflection anymore when in a code-generation context. This fails with the Symfony Metadata Factory that acceses the ReflectionClass after checking that the entity class_exists. This occurs when using code-generation in combination with the annotation driver.

This PR fixes the problem.
2012-01-28 15:14:48 +01:00
Benjamin Eberlei
c3f0ec74a1 Make DoctrineBundle fowards compatible with Doctrine 2.2 2012-01-28 09:08:30 +01:00
Manuel Kiessling
6090deef90 [FormType] Adopted MoneyTypeTest::testMoneyPatternWorksForYen to CS 2012-01-26 15:43:25 +01:00
Manuel Kiessling
e814d273c2 [FormType] Fixed broken MoneyType regexp for JPY
The regexp in MoneyType doesn't work if currency format has no decimal
(like JPY) and doesn't work either if the currency symbol is unicode

This change fixes both issues and adds a unit test
2012-01-26 15:43:25 +01:00
Fabien Potencier
4ae41a56c4 merged branch Seldaek/esi_escape (PR #3185)
Commits
-------

7f96c8a [HttpKernel] Prevent php script execution in cached ESI pages using HttpCache

Discussion
----------

[HttpKernel] Escape php tags to avoid eval() injection in HttpCache
2012-01-25 16:03:50 +01:00
Jordi Boggiano
7f96c8ad17 [HttpKernel] Prevent php script execution in cached ESI pages using HttpCache 2012-01-24 19:27:21 +01:00
Gerard van Helden
7c338de412 changed docs as proposed in #3110 2012-01-22 10:13:52 +01:00
Fabien Potencier
3c0b9c5b20 [DoctrineBridge] enhanced an error message (closes #3155) 2012-01-22 10:12:26 +01:00
Fabien Potencier
a0818c753e merged branch umpirsky/2.0 (PR #3169)
Commits
-------

1f733e1 Updated Serbian translation.

Discussion
----------

Updated Serbian translation.

Fixed as requested by stof https://github.com/symfony/symfony/pull/3167#issuecomment-3598347
2012-01-22 07:33:27 +01:00
Sasa Stamenkovic
1f733e1168 Updated Serbian translation. 2012-01-21 23:34:49 +01:00
Fabien Potencier
812c72ad8c fixed CS 2012-01-18 13:29:06 +01:00
Fabien Potencier
3d72fae38e merged branch ManuelKiessling/ticket_3139 (PR #3140)
Commits
-------

a1317c3 [Locale][Testing] Fixed breaking tests if 'intl' extension is not installed (#3139)

Discussion
----------

[Locale][Testing] Fixed breaking tests if 'intl' extension is not installed (#3139)

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: ![Build Status](https://secure.travis-ci.org/ManuelKiessling/symfony.png?branch=ticket_3139) Fixes the following tickets: #3139
Todo: -

Symfony\Tests\Component\Locale\LocaleTest->testGetDisplayCountriesReturnsFullListForSubLocale()
fails with a fatal error if the PHP extension 'intl' is not installed on the system.
Added a check which skips the affected tests if the extension is not available.
Fixes #3139
2012-01-17 22:31:20 +01:00
Fabien Potencier
0dd32929e7 merged branch hhamon/form_extension_typo_fix (PR #3138)
Commits
-------

d0da2f9 [Bridge] [Twig] fixed typo in a comment of the Twig FormExtension extension.

Discussion
----------

[Bridge] [Twig] fixed typo in a comment of the Twig FormExtension extension

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
2012-01-17 22:30:37 +01:00
Manuel Kiessling
a1317c3437 [Locale][Testing] Fixed breaking tests if 'intl' extension is not installed (#3139)
Symfony\Tests\Component\Locale\LocaleTest->testGetDisplayCountriesReturnsFullListForSubLocale()
fails with a fatal error if the PHP extension 'intl' is not installed on the system.
Added a check which skips the affected tests if the extension is not available.
Fixes #3139
2012-01-17 18:44:55 +01:00
Hugo Hamon
d0da2f921a [Bridge] [Twig] fixed typo in a comment of the Twig FormExtension extension. 2012-01-17 16:45:13 +01:00
Fabien Potencier
51ecb3c07b fixed CS 2012-01-17 10:56:02 +01:00
Fabien Potencier
706020b38a merged branch henrikbjorn/2.0 (PR #3133)
Commits
-------

959614b Use reflection to determaine the correct path for component validation.xml file

Discussion
----------

2.0

Validation.xml use reflection to guess path
2012-01-17 10:54:23 +01:00
Henrik Bjørnskov
959614b4ca Use reflection to determaine the correct path for component validation.xml file 2012-01-17 10:37:10 +01:00
Fabien Potencier
733ac9de7a [HttpFoundation] fixed exception message (closes #3123) 2012-01-16 22:09:07 +01:00
Fabien Potencier
33170ae572 merged branch ManuelKiessling/ticket_3090_bugfix (PR #3127)
Commits
-------

7e14a56 [Locale] Removed unneccesary semi-colon
cacc880 [Bugfix][Locale] Fixed incomplete Locale data loading

Discussion
----------

[Bugfix][Locale] Fixed incomplete Locale data loading

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: ![Build Status](https://secure.travis-ci.org/ManuelKiessling/symfony.png) Fixes the following tickets: #3090
Todo: -

Sublocales like de_CH returned only incomplete results for
getDisplayCountries(), getDisplayLanguages() and getDisplayLocales(),
consisting only of results specific for this sublocale, but without the
results of their respective parent locale

This PR was https://github.com/symfony/symfony/pull/3106 before - reopened it as a new PR because the commits were too chaotic.
2012-01-16 21:58:33 +01:00
Fabien Potencier
056c16e3fd merged branch havvg/patch-2 (PR #3125)
Commits
-------

360f574 fix expected return type of MutableAclProvider

Discussion
----------

fix expected return type of MutableAclProvider
2012-01-16 21:51:44 +01:00
Manuel Kiessling
7e14a56392 [Locale] Removed unneccesary semi-colon 2012-01-16 19:25:01 +01:00
Manuel Kiessling
cacc880929 [Bugfix][Locale] Fixed incomplete Locale data loading
Sublocales like de_CH returned only incomplete results for
getDisplayCountries(), getDisplayLanguages() and getDisplayLocales(),
consisting only of results specific for this sublocale, but without the
results of their respective parent locale
2012-01-16 17:25:42 +01:00
Toni Uebernickel
360f5745cb fix expected return type of MutableAclProvider 2012-01-16 15:24:43 +01:00
Fabien Potencier
33f68fe821 added a missing use statement 2012-01-16 07:42:19 +01:00
Fabien Potencier
119a24f016 merged branch makasim/yaml-throw-not-readable (PR #3105)
Commits
-------

7961014 [Yaml][Parser] changes according review
efce640 [Yaml][Parser] throw an exception if not readable

Discussion
----------

[Yaml][Parser] throw an exception if service file not readable.

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #3077
Todo: -

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

by makasim at 2012-01-13T15:49:49Z

 @fabpot done
2012-01-13 22:27:28 +01:00
Fabien Potencier
64bd058ba4 merged branch kriswallsmith/http/forwarded-port (PR #3111)
Commits
-------

d67d419 [HttpFoundation] added missing trustProxy condition

Discussion
----------

[HttpFoundation] check trust setting in getPort()

Added a missing `self::$trustProxy` check in `Request::getPort()`.

```
Bug fix: yes
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
```
2012-01-13 22:26:43 +01:00
Kris Wallsmith
d67d419f3c [HttpFoundation] added missing trustProxy condition 2012-01-13 11:05:57 -08:00
Maksim Kotlyar
7961014140 [Yaml][Parser] changes according review 2012-01-13 17:48:38 +02:00
Maksim Kotlyar
efce640a5e [Yaml][Parser] throw an exception if not readable 2012-01-13 10:48:50 +02:00
Fabien Potencier
02a12b2c5c merged branch kriswallsmith/strpos (PR #3097)
Commits
-------

fe62401 optimized string starts with checks

Discussion
----------

optimized string starts with checks

Doing this with strpos() is slightly faster than substr().

```
Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
```

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

by vicb at 2012-01-11T19:58:27Z

How faster ? even if the string is long and do not contain an occurrence of the sub-string ?
Looks like micro-(not)-optimizations to me.

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

by kriswallsmith at 2012-01-11T20:04:26Z

The difference is about 0.1s when repeated 1M times.

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

by vicb at 2012-01-11T20:08:12Z

% would be better (machine & env independant), what string size, what match offset ?
I personally vote against (`substr` is more meaningful to me and I do not like micro-optims)

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

by kriswallsmith at 2012-01-11T20:12:34Z

I personally consider this a coding standard but don't want to bikeshed here :)

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

by vicb at 2012-01-11T20:28:08Z

I have [tried](https://gist.github.com/1596588) at home.
`strpos ` **is** faster unless you have a very long string, probably because you do not need to create a new string, interesting, thanks for the tip.

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

by Tobion at 2012-01-11T22:40:18Z

I think strpos() is more useful. Say you want to change the string you have to replace 2 variables (the text and the length parameter) when using substr(). It could also introduce bugs when they don't match. With strpos() it's only the text.

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

by robocoder at 2012-01-11T22:43:22Z

alternate micro-optimization that doesn't create a temporary string:
```
strncmp($v, "@", 1) === 0
```

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

by Tobion at 2012-01-11T22:47:12Z

@robocoder probably the fastest solution but needs to be benchmarked
2012-01-12 18:48:45 +01:00
Fabien Potencier
fb3513a50e merged branch kriswallsmith/kernel/unnecessary-regex (PR #3104)
Commits
-------

7f7f82a [HttpKernel] removed unnecessary regex

Discussion
----------

[HttpKernel] removed unnecessary regex

The pattern was also flawed because of the unescaped `.`

```
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
```
2012-01-12 18:47:17 +01:00
Fabien Potencier
c185302c0d merged branch canni/fix_collection_validator (PR #3078)
Commits
-------

7f7c2a7 Add prof-of-concept test, this test will fail without changes in previous commit
253eeba [BugFix][Validator] Fix for PHP incosistent behaviour of ArrayAccess

Discussion
----------

[BugFix][Validator] Fix for PHP incosistent behaviour of ArrayAccess

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2779
Todo: -

[![Build Status](https://secure.travis-ci.org/canni/symfony.png)](http://travis-ci.org/canni/symfony)

Because PHP function `array_key_exists` is buggy, it works great with native
PHP `ArrayObject` instances, but hand written implementations of `ArrayAccess`
and `Traversable` objects will fail to work with `CollectionValidator`

Tests from second commit are valid use cases, but without this change, they will fail.
2012-01-12 18:45:54 +01:00
Kris Wallsmith
7f7f82a53e [HttpKernel] removed unnecessary regex
The pattern was also flawed because of the unescaped `.`
2012-01-12 09:33:03 -08:00
Kris Wallsmith
fe62401907 optimized string starts with checks
Doing this with strpos() is slightly faster than substr().
2012-01-11 11:33:56 -08:00
Fabien Potencier
7ee2f6da75 fixed some phpdoc 2012-01-11 15:46:50 +01:00
Fabien Potencier
f57615b4a4 merged branch kriswallsmith/form/validator-fix (PR #3082)
Commits
-------

aa58330 [Form] fixed flawed condition

Discussion
----------

[Form] fixed flawed condition

The validate() method always returns an object. The test is whether there are violations in that object.

```
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
```

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

by fabpot at 2012-01-10T21:22:10Z

What about removing the if condition altogether?

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

by kriswallsmith at 2012-01-10T21:23:55Z

This way we avoid creating an `ArrayIterator` for no reason.
2012-01-11 08:15:19 +01:00
Fabien Potencier
92c048340b merged branch drak/psr0 (PR #3089)
Commits
-------

39f1ecd [ClassLoader] Update PSR-0 reference.

Discussion
----------

[ClassLoader] Update reference to PSR-0

Bug fix: no
Feature addition: n/a
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
2012-01-11 08:14:47 +01:00
Drak
39f1ecd96d [ClassLoader] Update PSR-0 reference. 2012-01-11 09:27:00 +05:45
Kris Wallsmith
aa58330047 [Form] fixed flawed condition 2012-01-10 09:16:51 -08:00
Dariusz Górecki
7f7c2a7094 Add prof-of-concept test, this test will fail without changes in previous commit 2012-01-10 11:51:28 +01:00
Dariusz Górecki
253eebad88 [BugFix][Validator] Fix for PHP incosistent behaviour of ArrayAccess
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2779
Todo: -

Because PHP function `array_key_exists` is buggy, it works great with native
PHP `ArrayObject` instances, but hand written implementations of `ArrayAccess`
and `Traversable` objects will fail to work with `CollectionValidator`
2012-01-10 11:06:00 +01:00
Fabien Potencier
74961c8d22 merged branch maerlyn/hungarian_translation_2.0 (PR #3076)
Commits
-------

63e7f95 updated hungarian translations

Discussion
----------

Hungarian translations for 2.0

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -

I have translated the trans-unit #41.
2012-01-10 10:34:36 +01:00
Maerlyn
63e7f95f60 updated hungarian translations 2012-01-10 09:39:04 +01:00
Fabien Potencier
1cbb041b99 merged branch pulzarraider/updated_sk_validator_2_0 (PR #3073)
Commits
-------

127cf52 Updated validators.sk.xlf file (for Symfony 2.0)

Discussion
----------

[FrameworkBundle] Slovak translations updated

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

This PR is for Symfony 2.0.
2012-01-10 07:35:20 +01:00