This PR was merged into the 2.0 branch.
Commits
-------
53ccc2c [Yaml] fixed ignored text when parsing an inlined mapping or sequence (closes#6786)
Discussion
----------
[Yaml] fixed ignored text when parsing an inlined mapping or sequence (closes#6786)
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #6786
| License | MIT
| Doc PR | n/a
This PR was merged into the 2.0 branch.
Commits
-------
fea20b7 [Yaml] fixed#6770
Discussion
----------
[Yaml] fixed parsing of negative integers (2.0 branch)
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #6770
| License | MIT
| Doc PR | n/a
Note that an unrelated test fixture for large integers had to be changed to work on systems with 64-bit integer support because of the change from `assertEquals()` to `assertSame()`. Please see the diff for clarification.
* 2.0:
[Yaml] fixed unneeded BC break
[DependencyInjection] fixed a bug in the YAML dumper where references where not converted to the @ notation
[Yaml] fixed typo
updated VERSION for 2.0.22
update CONTRIBUTORS for 2.0.22
updated CHANGELOG for 2.0.22
Conflicts:
src/Symfony/Component/HttpKernel/Kernel.php
* 2.0:
[Yaml] fixed default value
Added Yaml\Dumper::setIndentation() method to allow a custom indentation level of nested nodes.
added a way to enable/disable object support when parsing/dumping
added a way to enable/disable PHP support when parsing a YAML input via Yaml::parse()
[Console] fixed input bug when the value of an option is empty (closes#6649, closes#6689)
Conflicts:
src/Symfony/Component/Yaml/Dumper.php
src/Symfony/Component/Yaml/Parser.php
src/Symfony/Component/Yaml/Tests/DumperTest.php
src/Symfony/Component/Yaml/Tests/ParserTest.php
src/Symfony/Component/Yaml/Yaml.php
YAML does not specify an absolute indentation level, but a consistent indentation of nested nodes only: http://www.yaml.org/spec/1.2/spec.html#space/indentation/
Projects that are generally using 2 spaces for indentation should be able to retain consistency with their coding standards by supplying a custom value for the new $indent parameter added to Yaml::dump(), or the new Dumper::setIndentation() method.
The new parameter is a backwards-compatible API addition and defaults to the previous default of 4 (which was changed from 2 via PR #2242 only recently).
Conflicts:
src/Symfony/Component/Yaml/Dumper.php
src/Symfony/Component/Yaml/Yaml.php
By default, object support is disabled, and instead of throwing an
exception when an object is handled, null is returned.
If you do need object support, enable it via:
Yaml::dump($data, false, true);
If you want an exception to be thrown in case an invalid type is handled
(a PHP resource or a PHP object), pass true as the second argument:
Yaml::dump($data, true, true);
The same can be done when parsing:
Yaml::parse($data, 2, false, true);
PHP support when parsing a file has been disabled by default.
If you do need PHP support when parsing a YAML file, enable it via:
Yaml::setPhpParsing(true);
As of Symfony 2.1, PHP support is disabled by default, and support will
be removed in Symfony 2.3.
This PR was merged into the 2.1 branch.
Commits
-------
a62e04f [Process] Fix docblocks, remove `return` from `PhpProcess#start()` as parent returns nothing, cleaned up `ExecutableFinder`
Discussion
----------
[2.1][Process] Fix docblocks, remove `return` from `PhpProcess#start()`
This PR was merged into the 2.1 branch.
Commits
-------
4991607 Fix version_compare() calls for PHP 5.5.
34def9f Handle the deprecation of IntlDateFormatter::setTimeZoneId() in PHP 5.5.
Discussion
----------
[Form] [Locale] PHP 5.5 compatibility fixes
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: N/A
Todo: None
License of the code: MIT
Documentation PR: N/A
IntlDateFormatter::setTimeZoneId() is deprecated in PHP 5.5, which results in E_DEPRECATED errors when using the date form type. This PR works around that.
Furthermore, the version_compare() tests used in locale to detect PHP 5.5 are broken with snapshot and Git builds of PHP. I've also committed a fix for those tests in this PR.
---------------------------------------------------------------------------
by stof at 2013-01-10T08:24:15Z
shouldn't it even be done in 2.0 as it is a bugfix ?
---------------------------------------------------------------------------
by LawnGnome at 2013-01-11T00:49:11Z
Possibly — I don't know enough about Symfony's release management to know whether this is appropriate for 2.0, and I was mostly scratching my own itch, honestly.
---------------------------------------------------------------------------
by stof at 2013-01-11T01:51:35Z
well, it is a bugfix and 2.0 is also impacted, so it should be done in it.
---------------------------------------------------------------------------
by LawnGnome at 2013-01-11T02:52:21Z
The diff for 2.0 looks like it'll be just the StubIntlDateFormatter.php changes — the deprecated method isn't called in DateType on that branch, and there aren't any StubIntlDateFormatter tests on 2.0. How do you want that submitted — as a separate PR against 2.0?
---------------------------------------------------------------------------
by fabpot at 2013-01-11T07:20:18Z
@LawnGnome A separate pull request would be good. Thanks.
---------------------------------------------------------------------------
by LawnGnome at 2013-01-11T08:29:48Z
2.0 PR added as #6699.
* 2.0:
Fix version_compare() calls for PHP 5.5.
[Process] In edge cases `getcwd()` can return `false`, then `proc_open()` should get `null` to use default value (the working dir of the current PHP process)
Conflicts:
src/Symfony/Component/Form/Extension/Core/ChoiceList/MonthChoiceList.php
Until PHP 5.5 hits beta, the version number for Git builds is still 5.5.0-dev,
which is less than 5.5.0alpha1 according to version_compare(). This means that
the branches for 5.5 aren't being executed on 5.5 snapshots at present.
It is more common to use fully camel-cased names for test methods. Only some of the test methods are called with underscore notation. To avoid confusion it is better to be consistent.
Until PHP 5.5 hits beta, the version number for Git builds is still 5.5.0-dev,
which is less than 5.5.0alpha1 according to version_compare(). This means that
the branches for 5.5 aren't being executed on 5.5 snapshots at present.
This PR was squashed before being merged into the 2.1 branch (closes#6611).
Commits
-------
bde5a7f [HttpKernel] Clarify misleading comment in ExceptionListener
Discussion
----------
[HttpKernel] Clarify misleading comment in ExceptionListener
Regression from 295860dfaf.
---------------------------------------------------------------------------
by fabpot at 2013-01-08T09:02:53Z
The comment is right. Returning without a Response will re-throw the exception (in HttpKernel).
---------------------------------------------------------------------------
by staabm at 2013-01-08T11:00:36Z
so the comment should point out, that the httpkernel will rethrow the exception in that case?
---------------------------------------------------------------------------
by igorw at 2013-01-08T13:38:43Z
I missed that on the commit I linked. I've updated the patch to re-introduce the comment but clarify that `throw` is in HttpKernel.
* 2.0:
[Bundle] [FrameworkBundle] fixed indentation in esi.xml services file.
[TwigBundle] There is no CSS visibility of display, should be visible instead
[DependencyInjection] fixed a bug where the strict flag on references were lost (closes#6607)
[HttpFoundation] Check if required shell functions for `FileBinaryMimeTypeGuesser` are not disabled
[CssSelector] added css selector with empty string
[HttpFoundation] Docblock for Request::isXmlHttpRequest() now points to Wikipedia
[DependencyInjection] refactored code to avoid logic duplication
Conflicts:
src/Symfony/Bundle/FrameworkBundle/Resources/config/esi.xml
src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
src/Symfony/Component/HttpFoundation/File/MimeType/FileBinaryMimeTypeGuesser.php
This PR was merged into the 2.1 branch.
Commits
-------
2155719 [Component] [Security] fixed PSR-2 coding violation in ClassUtilsTest class.
Discussion
----------
[2.1] [Component] [Security] fixed PSR-2 coding violation in ClassUtilsTest class
Bug fix: no
Feature addition: no
Backwards compatibility break: no
Fixes the following tickets: -
Todo: -
License of the code: MIT
This PR was merged into the 2.1 branch.
Commits
-------
55aa012 [Form] Fixed EntityChoiceList when loading objects with negative integer IDs
Discussion
----------
[Form] Fixed EntityChoiceList when loading objects with negative integer IDs
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #6610
Todo: -
License of the code: MIT
Documentation PR: -
---------------------------------------------------------------------------
by stof at 2013-01-08T10:21:57Z
wouldn't you need to do the opposite replacement when loading the result ? And shouldn't it be done in the propel bridge too ?
---------------------------------------------------------------------------
by bschussek at 2013-01-08T10:25:29Z
@stof No, indices aren't used for loading the result, just values. Yes this should be done for the propel bridge, but that bridge is missing even the tests for the ID-as-identifier usage. Do you want to create a PR?
This PR was merged into the 2.0 branch.
Commits
-------
1d362b8 [DependencyInjection] fixed a bug where the strict flag on references were lost (closes#6607)
Discussion
----------
[DependencyInjection] fixed a bug where the strict flag on references were lost (closes#6607)
This PR was merged into the 2.1 branch.
Commits
-------
8513777 [HttpFoundation] Update docblock for non-working method
Discussion
----------
[HttpFoundation] Update docblock for non-working method
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Rerences the following tickets: #6408
Todo: -
License of the code: MIT
Documentation PR: -
---------------------------------------------------------------------------
by piotrpasich at 2012-12-19T21:32:24Z
I think that we shouldn't comment it as not working but add new methods called countFlashes and countFlashesTypes. CountFlashesTypes should return count($this->flashBag) and countFlashes should count all items in every array inside flashbag.
---------------------------------------------------------------------------
by drak at 2012-12-20T17:43:38Z
ping @fabpot
This PR was merged into the 2.1 branch.
Commits
-------
33e9d00 [Form] Deleted references in FormBuilder::getFormConfig() to improve performance
Discussion
----------
[Form] Deleted references in FormBuilder::getFormConfig() to improve performance
Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #6558
Todo: -
License of the code: MIT
Documentation PR: -
---------------------------------------------------------------------------
by vicb at 2013-01-07T11:09:24Z
> Backwards compatibility break: no
Really ?
---------------------------------------------------------------------------
by vicb at 2013-01-07T12:27:37Z
Adding a public method is a BC break.
---------------------------------------------------------------------------
by bschussek at 2013-01-07T12:42:14Z
The method is inherited from the parent class, so the change should not affect BC.
---------------------------------------------------------------------------
by vicb at 2013-01-07T13:27:21Z
my bad.
This PR was merged into the 2.0 branch.
Commits
-------
666283c [HttpFoundation] Docblock for Request::isXmlHttpRequest() now points to Wikipedia
Discussion
----------
[2.0][HttpFoundation] Docblock for Request::isXmlHttpRequest()
Docblock now points to [Wikipedia entry](http://en.wikipedia.org/wiki/List_of_Ajax_frameworks#JavaScript) instead of pointing all known JS frameworks.
Replacement for #6444.
This PR was squashed before being merged into the 2.0 branch (closes#6271).
Commits
-------
dbafc2c [CssSelector] added css selector with empty string
Discussion
----------
[CssSelector] added css selector with empty string
---------------------------------------------------------------------------
by kosssi at 2012-12-14T18:29:40Z
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT
---------------------------------------------------------------------------
by stloyd at 2013-01-07T08:21:56Z
@fabpot ping
---------------------------------------------------------------------------
by fabpot at 2013-01-07T10:28:54Z
Sorry, but I don't understand the use case.
---------------------------------------------------------------------------
by kosssi at 2013-01-07T10:36:31Z
if you have this code :
\<img src="..." alt="">
you can find
$this->assertCount(1, $crawler->filter('img[alt=""]'));
---------------------------------------------------------------------------
by fabpot at 2013-01-07T10:40:12Z
Then, can you change the unit test with the real use case?
---------------------------------------------------------------------------
by kosssi at 2013-01-07T11:05:50Z
I don't know if it suits you
---------------------------------------------------------------------------
by fabpot at 2013-01-07T11:07:11Z
thanks
* 2.0:
Restrict Monolog version to be in version <1.3
[Console] Make getTerminalWith & getTerminalHeight public
[DependencyInjection] fixed PhpDumper optimizations when an inlined service depends on the current one indirectly
[DependencyInjection] fixed PhpDumper when an inlined service definition has some properties
[DependencyInjection] added some tests for PhpDumper when the container is compiled
[DependencyInjection] fixed CS
[Locale] Adjust `StubIntlDateFormatter` to have new methods added in PHP 5.5
[Locale] Fix failing `StubIntlDateFormatter` tests in PHP 5.5
[Locale] Fix failing `StubIntlDateFormatter` in PHP 5.5
[Form] Fix failing `MonthChoiceList` in PHP 5.5
Update .travis.yml
Conflicts:
src/Symfony/Bridge/Monolog/composer.json
src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php
src/Symfony/Component/Form/Extension/Core/ChoiceList/MonthChoiceList.php
tests/Symfony/Tests/Component/DependencyInjection/Fixtures/yaml/services9.yml
This PR was merged into the 2.0 branch.
Commits
-------
e0923ae [DependencyInjection] fixed PhpDumper optimizations when an inlined service depends on the current one indirectly
cd15390 [DependencyInjection] fixed PhpDumper when an inlined service definition has some properties
e939a42 [DependencyInjection] added some tests for PhpDumper when the container is compiled
3827e3e [DependencyInjection] fixed CS
Discussion
----------
[DependencyInjection] Fixed PhpDumper when compiling inlined services
This PR was merged into the 2.0 branch.
Commits
-------
f299bd0 [Console] Make getTerminalWith & getTerminalHeight public
Discussion
----------
[Console] Make getTerminalWith & getTerminalHeight public
Bug fix: yes
Feature addition: yes
Backwards compatibility break: no
Fixes the following tickets: ~
Todo: -
License of the code: MIT
Documentation PR: ~
After demand in #6567, I open an other one on the 2.0 branch.
This PR was merged into the 2.1 branch.
Commits
-------
fa6fb6f [Process] Do not reset stdout/stderr pipes on Interrupted system call
Discussion
----------
[Process][2.1] Do not reset stdout/stderr pipes on stream_select failure
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT
When `stream_select` is called and failed, pipes are currently reset to an empty array. As a result, both error-output and output are empty whereas the exitcode is 0 (successful process).
There is no reason (at least I don't see it) to reset pipes when an error occurs.
---------------------------------------------------------------------------
by fabpot at 2013-01-04T08:18:03Z
This behavior was introduced by @Seldaek in bcf8cf91. Any reason?
---------------------------------------------------------------------------
by Seldaek at 2013-01-04T17:22:33Z
The rationale was that if stream_select failed, it will fail every time (maybe this is an incorrect assumption and I introduced a bug there). Since the while loop checks for $this->pipes being not empty, if the process dies off and stream_select() starts failing, it will be stuck in the while loop forever. That's what I was fixing there. As far as I can tell, your fix reintroduces that problem. Can you explain a bit more what you mean by "error-output and output are empty"? Maybe adding a test for the case you are seeing would help too?
---------------------------------------------------------------------------
by romainneutron at 2013-01-04T17:47:00Z
Hi !
I'm actually using `Process` in a amqp client using PhpAmqpLib. Sometimes both output and error-output of a process are empty whereas the process returned with an exitcode equal to 0.
By *empty*, I mean that the output of both `$process->getOuptut()` and `$process->getErrorOuptut()` are equal to `''`.
I removed the `@` before the `stream_select` and realized that some calls where failing :
```
stream_select(): unable to select [4]: Interrupted system call (max_fd=13) in .../vendor/symfony/process/Symfony/Component/Process/Process.php on line 341
```
With my patch, it appears that if a `stream_select` call fails one time, it can be called with success a second time.
Adding a test case that triggers this error does not seem easy as it seems system related.
What do you think about it ?
---------------------------------------------------------------------------
by Seldaek at 2013-01-04T17:52:04Z
Ok I see. So I guess your fix makes sense since stream_select can fail legitimately, but it's not the whole story. If it fails because the process died off (or whatever the cause was on windows) we shouldn't keep trying forever. Maybe just adding a limit of N retries that is reset whenever a call succeeds would be enough to go over the odd system call being interrupted without allowing infinite loops. Not sure what N makes sense.
---------------------------------------------------------------------------
by igorw at 2013-01-04T17:53:45Z
As per the `stream_select` manpage it can return false when interrupted by a system call. That does not indicate that something is broken. However, I'm not sure if it is possible to distinguish between actual errors and interrupts without capturing and parsing the error message.
---------------------------------------------------------------------------
by romainneutron at 2013-01-04T18:50:56Z
I've updated the PR to consider the error message as it's currently the only solution to find out why `stream_select` failed
---------------------------------------------------------------------------
by romainneutron at 2013-01-04T18:59:15Z
Merged fixes suggested by @stloyd and @Seldaek
When `stream_select` is called and return false because of an `Interrupted
system call`, pipes are currently reset to an empty array.
As a result, both error-output and output are empty whereas the
exitcode is 0 (successful process).
This PR was merged into the 2.0 branch.
Commits
-------
73d9cef [Locale] Adjust `StubIntlDateFormatter` to have new methods added in PHP 5.5
b2ce983 [Locale] Fix failing `StubIntlDateFormatter` tests in PHP 5.5
913b564 [Locale] Fix failing `StubIntlDateFormatter` in PHP 5.5
8ae773b [Form] Fix failing `MonthChoiceList` in PHP 5.5
f4ce2f1 Update .travis.yml
Discussion
----------
[2.0] Add testing of PHP 5.5 on Travis-CI & fix failing code
This PR was merged into the 2.1 branch.
Commits
-------
d601b13 use the right RequestMatcherInterface
Discussion
----------
use the right RequestMatcherInterface
this fixes#6470 by using the right interface
* 2.0:
updated license year
Update src/Symfony/Component/HttpFoundation/Response.php
[Console] fixed unitialized properties (closes#5935)
[Bundle] [FrameworkBundle] fixed typo in phpdoc of the SessionListener.
bumped Symfony version to 2.0.21-DEV
updated VERSION for 2.0.21
updated CHANGELOG for 2.0.21
Conflicts:
src/Symfony/Bundle/SwiftmailerBundle/LICENSE
src/Symfony/Component/Filesystem/LICENSE
src/Symfony/Component/HttpFoundation/Response.php
src/Symfony/Component/HttpKernel/Kernel.php
This PR was merged into the 2.1 branch.
Commits
-------
6c5e615 [Form] Fixed DateType when used with the intl extension disabled.
Discussion
----------
[Form] Fixed DateType when used with the intl extension disabled
DateType's month select box returns timestamps when used with intl extension disabled (see #6485).
The reason for this is that stubbed formats use *L* instead of *M* for month representation. My fix is simply taking this into account when building array for the select box.
I didn't provide unit tests since they're disabled when intl extension is not enabled. I've only manually verified if the months array contains correct data.
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #6485
Todo: -
License of the code: MIT
Documentation PR: -
---------------------------------------------------------------------------
by bschussek at 2013-01-03T17:41:47Z
Doesn't this call for fixing the stub instead of changing the Form component?
---------------------------------------------------------------------------
by stof at 2013-01-03T17:50:49Z
@bschussek L and M are both valid for the month in Intl
---------------------------------------------------------------------------
by jakzal at 2013-01-03T17:52:41Z
[StubIntlDateFormatter uses FullTransformer](https://github.com/symfony/symfony/blob/2.1/src/Symfony/Component/Locale/Stub/StubIntlDateFormatter.php#L206) to format the date. [FullTransformer supports both *L* and *M*](https://github.com/symfony/symfony/blob/2.1/src/Symfony/Component/Locale/Stub/DateFormat/FullTransformer.php#L50) formats. Both formats are treated interchangeably.
This PR was merged into the 2.1 branch.
Commits
-------
c282a2b [DoctrineBridge] Allowing memcache port to be 0 to support memcache unix domain sockets.
Discussion
----------
[DoctrineBridge] Allowing memcache port to be 0 to support memcache unix domain sockets.
[DoctrineBridge] Allowing memcache port to be 0 to support memcache unix domain sockets.
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Fixes the following tickets: #6527
Todo: -
License of the code: MIT
Documentation PR: ~
This PR was merged into the 2.1 branch.
Commits
-------
bfccd28 HttpUtils must handle RequestMatcher too
Discussion
----------
HttpUtils must handle RequestMatcher too
2.1 introduced the RequestMatcher as alternative to UrlMatcher. but HttpUtils was not adjusted.
---------------------------------------------------------------------------
by lsmith77 at 2013-01-01T18:15:13Z
@fabpot could you have a look at this PR? would like to know if this will be addressed in core or if we need to find another solution inside the CMF routing.
This PR was merged into the 2.1 branch.
Commits
-------
ef6f241 [Locale] Fixed the StubLocaleTest for ICU versions lower than 4.8.
Discussion
----------
[Locale] Fixed the StubLocaleTest for ICU versions lower than 4.8
Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: no but for other reason in an another component
Fixes the following tickets: #5517
Todo: -
License of the code: MIT
Documentation PR: -
Symbol for Brazilian Real is BR$ only in ICU 4.8. All previous and later versions use R$.
Links to the relevant data files:
* http://source.icu-project.org/repos/icu/icu/tags/release-4-8/source/data/curr/en.txt
* http://source.icu-project.org/repos/icu/icu/tags/release-4-4/source/data/curr/en.txt
* http://source.icu-project.org/repos/icu/icu/tags/release-49-1/source/data/curr/en.txt
---------------------------------------------------------------------------
by jakzal at 2012-12-29T19:23:25Z
Note that currently *USE_ICU_DATA_VERSION* is required for some tests to pass. This is inconsistent with *Locale::getIcuDataVersion()* which returns *Locale::ICU_DATA_VERSION* if *USE_ICU_DATA_VERSION* is not set. Technically intl extension shouldn't be needed to run the stub tests.
Following code could fix the issue for StubLocale tests:
```php
class StubLocaleTest extends LocaleTestCase
{
// ...
protected function getIntlExtensionIcuVersion()
{
// Locale::getIcuDataVersion(), which is used to determine the directory of stubs,
// uses Locale::ICU_DATA_VERSION if USE_INTL_ICU_DATA_VERSION is not given
if (!getenv('USE_INTL_ICU_DATA_VERSION')) {
return Locale::ICU_DATA_VERSION;
}
return parent::getIntlExtensionIcuVersion();
}
}
```
This code cannot be placed in the LocaleTestCase as intl tests need the icu data version from the intl extension.
I'm not sure if this is desired and therefore I didn't include it in my PR. Let me know your thoughts and wether I should create another PR for this, use the current PR or forget about it.
This PR was merged into the 2.1 branch.
Commits
-------
81967f6 [Form] Fixed failing tests for DateTimeToStringTransformer.
Discussion
----------
[Form] Fixed failing tests for DateTimeToStringTransformer
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: -
Tests were only failing at the end of the month. Since February was used in the test cases, date was being moved to the next month (February has less days than other months).
If a day is not passed, \DateTime's constructor will set it to the first day of the month:
```php
var_dump(new \DateTime('2010-02'));
object(DateTime)#1 (3) {
["date"]=>
string(19) "2010-02-01 00:00:00"
["timezone_type"]=>
int(3)
["timezone"]=>
string(13) "Europe/London"
}
```
\DateTime is used in the test assertions.
However, DateTimeToStringTransformer::reverseTransform() uses \DateTime::createFromFormat(), which sets a missing day to the current day:
```php
var_dump(\DateTime::createFromFormat("Y-m", '2010-02'));
object(DateTime)#1 (3) {
["date"]=>
string(19) "2010-03-01 20:09:26"
["timezone_type"]=>
int(3)
["timezone"]=>
string(13) "Europe/London"
}
```
I changed the date in the test case to avoid failures. If we need to be sure that month's not going to be changed, I'll update my PR.
Tests were only failing at the end of the month. PHP uses current day if it is not passed. Since February was used in the test cases, date was being moved to the next month (February has less days than other months).
This PR was merged into the 2.1 branch.
Commits
-------
05fca6d use preferred_choices in favor of preferred_query
6855cff add preferred_query option to ModelType
Discussion
----------
[Propel1] add preferred_choices option to ModelType
This enables the ModelChoiceList to use 'preferred_choices' of the parent ChoiceType.
Ping @willdurand
---------------------------------------------------------------------------
by willdurand at 2012-12-22T09:39:39Z
👍
This PR was merged into the 2.1 branch.
Commits
-------
8beee64 [Form] Fix for `DateTimeToStringTransformer`
Discussion
----------
[Form] Fix for `DateTimeToStringTransformer`
Closes: #6429
---------------------------------------------------------------------------
by stloyd at 2012-12-21T08:19:11Z
@fabpot @bschussek Could you review this ? Thanks =)
---------------------------------------------------------------------------
by stloyd at 2012-12-23T13:51:36Z
Ping @fabpot (without this every PR gets false fail results from Travis-CI)
* 2.0:
bumped Symfony version to 2.0.21-DEV
[FrameworkBundle] fixed trusted_proxies configuration for some edge cases
[FrameworkBundle] fixed XSD for the trusted-proxies setting
updated VERSION for 2.0.20
update CONTRIBUTORS for 2.0.20
updated CHANGELOG for 2.0.20
Conflicts:
CONTRIBUTORS.md
src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php
src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml
src/Symfony/Component/HttpKernel/Kernel.php
* 2.0:
[FrameworkBundle] added support for URIs as an argument to HttpKernel::render()
[FrameworkBundle] restricted the type of controllers that can be executed by InternalController
Making it easier to grab the PR template.
fix double-decoding in the routing system
Conflicts:
README.md
src/Symfony/Bundle/FrameworkBundle/EventListener/RouterListener.php
src/Symfony/Component/Security/Http/HttpUtils.php
This PR was merged into the 2.0 branch.
Commits
-------
8b2c17f fix double-decoding in the routing system
Discussion
----------
fix double-decoding in the routing system
@fabpot @vicb This should fix it. You know what ;) Don't want to leak more information.
And the good thing, it's no hack nor does it break BC.
* 2.0:
Added comment
[FrameworkBundle] Added tests for trusted_proxies configuration.
[FrameworkBundle] Added a check on file mime type for CodeHelper::fileExcerpt()
checked for a potentially missing key
[FrameworkBundle] used the new method for trusted proxies
remove realpath call
Conflicts:
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
This PR was merged into the 2.0 branch.
Commits
-------
f0743b1 Merge pull request #1 from pylebecq/2.0
555e777 [FrameworkBundle] Added tests for trusted_proxies configuration.
a0e2391 [FrameworkBundle] used the new method for trusted proxies
Discussion
----------
[FrameworkBundle] used the new method for trusted proxies
This makes the framework bundle using the new method from the request class.
---------------------------------------------------------------------------
by fabpot at 2012-12-05T10:38:20Z
As this is a sensitive issue, can you add some tests? Thanks.
---------------------------------------------------------------------------
by bamarni at 2012-12-06T13:00:24Z
Well I don't know why it fails on travis, I can't run the full test suite locally because of a segfault but ```phpunit src/Symfony/Bundle/``` marks all the tests as passing.
---------------------------------------------------------------------------
by fabpot at 2012-12-06T13:08:11Z
But it looks like the failing tests come from what you've changed.
---------------------------------------------------------------------------
by bamarni at 2012-12-06T13:29:33Z
Yes, I'm not saying it's not my fault but I can't reproduce this as locally it tells me they pass, I'll try to fix this this evening.
---------------------------------------------------------------------------
by bamarni at 2012-12-06T17:49:28Z
Apparently it fails only when running the whole testsuite, looking at other travis builds I can see this one on 2.0 : https://travis-ci.org/symfony/symfony/jobs/3495511 which fails in a similar way than here (https://travis-ci.org/symfony/symfony/jobs/3530928). Because of a place trying to access an undefined $_SERVER key : ```PHP Notice: Undefined index: SCRIPT_NAME ...``` but I can't find where, and the stack trace references some phpunit classes.
I'd be happy if someone could give me some pointers in here as I don't have any clue about how to fix this..
---------------------------------------------------------------------------
by bamarni at 2012-12-06T18:00:57Z
As a consulsion I'd say I can't run the whole testsuite locally (it fails even when I revert my commit), so there is no reliable way for me to fix this, if anyone is up for continuing this feel free.
---------------------------------------------------------------------------
by fabpot at 2012-12-11T09:47:48Z
@bamarni Can you just update this PR with the code change and no tests at all? I will then finish the PR. Thanks.
---------------------------------------------------------------------------
by bamarni at 2012-12-11T16:58:17Z
@fabpot: thanks for helping me out on this, hope you won't run into the same issue!
This PR was merged into the 2.1 branch.
Commits
-------
098b593 [Session] Added exception to save method
6b9ee87 [Session] Fixed a bug with the TestListener
Discussion
----------
[Session] Fixed bug with TestListener
Fixed a bug where an unstarted mock session would be emptied with a save. Here are the steps to reproduce:
Use the test client from Symfony\Bundle\FrameworkBundle\Test\WebTestCase::createClient(), and add something to its session. (I actually had it authenticate against a firewall).
Take the cookies of this first test client and add them to a second test client
Have the second test client request a URL that results in a 404
Since the 404 does not need to start the session, hence when save is called (automatically), the mock session is overwritten with an empty array. This does not happen with the other session handlers.
The added unit test in this PR shows this problem. If this PR gets accepted, will it also get merged into the 2.1.x-dev branch?
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes (The broken test seems to be unrelated to this change)
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: -
This is a follow up PR since my original one (https://github.com/symfony/symfony/pull/6342) was against the wrong upstream branch.
This PR was merged into the 2.1 branch.
Commits
-------
f24e3d7 [HttpKernel] Revise MongoDbProfilerStorage::write() return value
78c5273 [Session] Document Mongo|MongoClient argument type instead of "object"
de19a81 [HttpKernel] Support MongoClient and Mongo connection classes
b28af77 [Session] Support MongoClient and Mongo connection classes
20e93bf [Session] Utilize MongoDB::selectCollection()
Discussion
----------
[2.1] Support PHP MongoDB driver 1.3.0+ in profiler/session classes
> Bug fix: yes
> Feature addition: yes
> Backwards compatibility break: no
> Symfony2 tests pass: yes
> Fixes the following tickets: #6130
> License of the code: MIT
I don't believe this is a BC break, but just to confirm: the MongoDbSessionHandler constructor signature changed, as I removed the `Mongo` type hint.
Bug fix entails allowing MongoClient to be used by default if the new driver is available, since the original Mongo class is deprecated. I also removed the assumption about `MongoCollection::update()`'s return value, since it may be a status array now.
---------------------------------------------------------------------------
by jmikola at 2012-12-13T22:04:47Z
Lots of test failures, but they appear to be unrelated.
MongoClient defaults its write concern to w=1 (i.e. "safe" writes), which means update() may return an array instead of boolean true. Check for this before returning from write().
This PR was merged into the 2.1 branch.
Commits
-------
b20c5ca [Form] Fixed reverse transformation of values in DateTimeToStringTransformer
Discussion
----------
[Form] Fixed reverse transformation of values in DateTimeToStringTransformer
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: -
The parts not given in the format are reset to the corresponding values of
the UNIX base timestamp. For example, when parsing with the format "Y-m-d",
parsing
"2012-05-18"
now results in the date
"2012-05-18 00:00:00 UTC"
instead of
"2012-05-18 12:58:27 UTC"
as before, where the time part corresponded to the local server time.
Another example: When parsing with the format "H:i:s", parsing
"12:58:27"
now results in
"1970-01-01 12:58:27 UTC"
instead of
"2012-12-13 12:58:27 UTC"
as before, where again the date part corresponded to the local server time.
This behavior is now consistent with DateTimeToArrayTransformer and
DateTimeToLocalizedStringTransformer.
The parts not given in the format are reset to the corresponding values of
the UNIX base timestamp. For example, when parsing with the format "Y-m-d",
parsing
"2012-05-18"
now results in the date
"2012-05-18 00:00:00 UTC"
instead of
"2012-05-18 12:58:27 UTC"
as before, where the time part corresponded to the local server time.
Another example: When parsing with the format "H:i:s", parsing
"12:58:27"
now results in
"1970-01-01 12:58:27 UTC"
instead of
"2012-12-13 12:58:27 UTC"
as before, where again the date part corresponded to the local server time.
This behavior is now consistent with DateTimeToArrayTransformer and
DateTimeToLocalizedStringTransformer.
This PR was merged into the 2.0 branch.
Commits
-------
e6bb156 remove realpath call
Discussion
----------
[HttpKernel] remove realpath call
I'm trying to create an executable phar archive from a Symfony application, but when I run the phar, it fails to find any commands because of this php bug/feature:
https://bugs.php.net/bug.php?id=52769
After this change, my archive works just like a normal app/console call
* 2.0:
fixed CS
removed the Travis icon (as this is not stable enough -- many false positive, closes#6186)
[Config] Loader::import must return imported data
[HttpFoundation] fixed a small regression
Conflicts:
README.md
src/Symfony/Bridge/Twig/Extension/FormExtension.php
src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/attributes.html.php
src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_widget.html.php
src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php
src/Symfony/Component/Form/Form.php
src/Symfony/Component/HttpFoundation/Request.php
src/Symfony/Component/HttpFoundation/SessionStorage/PdoSessionStorage.php
tests/Symfony/Tests/Bridge/Doctrine/Logger/DbalLoggerTest.php
I'm trying to create an executable phar archive from a Symfony application, but when I run the phar, it fails to find any commands because of this php bug/feature:
https://bugs.php.net/bug.php?id=52769
After this change, my archive works just like a normal app/console call
When having a Cache-Control header like:
max-age="0"
isset($match[2]) is true but $match[2] containing: "0", it is evaluated
as false and 'true' will be set to "max-age" entry instead of "0".
This PR was merged into the 2.1 branch.
Commits
-------
6e7e08f [Form] Fixed the default value of "format" in DateType to DateType::DEFAULT_FORMAT if "widget" is not "single_text"
Discussion
----------
[Form] Fixed the "format" option in DateType
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #6141
Todo: -
License of the code: MIT
Documentation PR: -
This PR fixes a regression introduced in #4839. To quote that PR:
> This PR changes DateType and DateTimeType to support HTML5 by default when setting the option "widget" to "single_text".
In reality, the "format" option now defaults to the HTML5 format always, not just when "widget" is "single_text". This is fixed here.
The second commit in this PR removes special characters between select/text fields. What, with German locale, was
```
<day input>.<month input>.<year input>
```
before is now
```
<day input><month input><year input>
```
This is the way date fields are represented on the majority of websites. If you *need* separators, you can have them by setting the "format" option to a custom value:
```php
$builder->add('myDate', 'date', array(
'format' => 'dd.MM.yyyy',
));
```
---------------------------------------------------------------------------
by fabpot at 2012-12-07T08:52:21Z
The second commit should probably be done on master and it changes the behavior.
---------------------------------------------------------------------------
by bschussek at 2012-12-07T12:23:22Z
Ok, I removed the second commit now and removed the entries from the CHANGELOG.
* 2.0:
[HttpFoundation] changed UploadedFile::move() to use move_uploaded_file() when possible (closes#5878, closes#6185)
[HttpFoundation] added a check for the host header value
Conflicts:
src/Symfony/Component/HttpFoundation/File/File.php
src/Symfony/Component/HttpFoundation/Request.php
src/Symfony/Component/HttpFoundation/Tests/RequestTest.php
This PR was merged into the 2.0 branch.
Commits
-------
0489799 [HttpFoundation] added a check for the host header value
Discussion
----------
[HttpFoundation] added a check for the host header value
alternative for #3865
This PR was merged into the 2.1 branch.
Commits
-------
b604eb7 [DoctrineBridge] Improved performance of the EntityType when used with the "query_builder" option
db2ee54 [DoctrineBridge] Improved exception message
99321cb [DoctrineBridge] Fixed: Exception is thrown if the entity class is not known to Doctrine
Discussion
----------
[DoctrineBridge] fixed caching when EntityType is used with the "query_builder" option
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: -
* 2.0:
[TwigBundle] Moved the registration of the app global to the environment
needs to use simpleContent in xsd to allow empty elements
bumped Symfony version to 2.0.19-DEV
removed wrong routing xsd statement `mixed="true"`
removed unused attribute from routing.xsd
updated VERSION for 2.0.19
update CONTRIBUTORS for 2.0.19
updated CHANGELOG for 2.0.19
Conflicts:
CONTRIBUTORS.md
src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml
src/Symfony/Bundle/TwigBundle/TwigEngine.php
src/Symfony/Component/HttpKernel/Kernel.php
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
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.
This PR was merged into the 2.0 branch.
Commits
-------
d5623b4 removed unused attribute from routing.xsd
Discussion
----------
removed unused attribute from routing.xsd
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.
* 2.0:
replaced magic strings by proper constants
refactored tests for Request
fixed the logic in Request::isSecure() (if the information comes from a source that we trust, don't check other ones)
added a way to configure the X-Forwarded-XXX header names and a way to disable trusting them
fixed algorithm used to determine the trusted client IP
removed the non-standard Client-IP HTTP header
Conflicts:
src/Symfony/Component/HttpFoundation/Request.php
src/Symfony/Component/HttpFoundation/Tests/RequestTest.php
* 2.0:
[DependencyInjection] fixed composer.json
[Form] Updated checks for the ICU version from 4.5+ to 4.7+ due to test failures with ICU 4.6
fixed CS
small fix of #5984 when the container param is not set
fixed CS
Use better default ports in urlRedirectAction
Add tests for urlRedirectAction
Update src/Symfony/Component/DomCrawler/Tests/FormTest.php
Update src/Symfony/Component/DomCrawler/Form.php
[Security] remove escape charters from username provided by Digest DigestAuthenticationListener
[Security] added test extra for digest authentication
fixed CS
[Security] Fixed digest authentication
[Security] Fixed digest authentication
[SecurityBundle] Convert Http method to uppercase in the config
Use Norm Data instead of Data
Conflicts:
src/Symfony/Bridge/Doctrine/Form/EventListener/MergeCollectionListener.php
src/Symfony/Bundle/FrameworkBundle/Controller/RedirectController.php
src/Symfony/Component/DependencyInjection/composer.json
This PR was merged into the 2.1 branch.
Commits
-------
06ee53b [Form] improve error message with a "hasser" hint for PropertyAccessDeniedException
Discussion
----------
[Form] improve error msg w/ a "hasser" hint for PropertyAccessDeniedException
"Hasser" support was added under the 2.1 branch of the Form component
Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: no, but fails exactly the same as without this fix
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: symfony/symfony-docs#1958
Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: no, but fails exactly the same as without this fix
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: symfony/symfony-docs#1958
This PR was merged into the 2.1 branch.
Commits
-------
82334d2 Force loader to be null or a EntityLoaderInterface
Discussion
----------
Force loader to be null or a EntityLoaderInterface
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.
This PR was merged into the 2.1 branch.
Commits
-------
84635bd [Form] allowed no type guesser to be registered
Discussion
----------
[Form] made the factory builder pass null when no type guesser registered
reopened#5422 against 2.1 as it's a bug fix
---------------------------------------------------------------------------
by stof at 2012-10-13T21:23:34Z
@fabpot anything left for this PR ?
---------------------------------------------------------------------------
by fabpot at 2012-10-14T09:41:29Z
@bamarni Can you add some unit tests and also update the FormExtensionInterface interface phpdoc as `getTypeGuesser` can now return `null`? Thanks. ping @bschussek
---------------------------------------------------------------------------
by bamarni at 2012-10-14T17:10:27Z
I've added a few tests covering this.
@fabpot : the phpdoc is already correct, it currently can return null, this only occurs with this convenient class.
---------------------------------------------------------------------------
by bschussek at 2012-10-16T07:43:41Z
This PR breaks FormFactory::createBuilderForProperty(), which expects a guesser to be present. Can you check the component for other uses of the guesser and add a null-check there?
---------------------------------------------------------------------------
by bamarni at 2012-10-16T10:57:54Z
I cannot find other places than the factory (searching for 'getTypeGuesser').
---------------------------------------------------------------------------
by bschussek at 2012-11-08T16:58:37Z
You should also adapt `FormRegistry::getTypeGuesser()` not to build a `FormTypeGuesserChain` if the array of guessers is empty. In that case it will return now `null` (adapt the doc block). We also need a different was of checking if the type guessers have already been parsed in FormRegistry. Otherwise the first if condition in `FormRegistry::getTypeGuesser()` will never become false. You could for example initialize the property `$guesser` to `false` and only set it to `null` after the first run of `getTypeGuesser()`.
---------------------------------------------------------------------------
by bamarni at 2012-11-08T18:40:00Z
good catch I had missed it! I've applied your suggestion in the latest commit. Do you see anything else before I squash?
---------------------------------------------------------------------------
by bschussek at 2012-11-08T18:45:15Z
A test for `FormRegistry::getTypeGuesser()` would of course be awesome.
---------------------------------------------------------------------------
by bamarni at 2012-11-08T18:52:13Z
Then it was already awesome! (see https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/Tests/FormRegistryTest.php#L252)
I've also added one for the null case if it's what you meant.
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.
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!
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' ] }
```
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.
This PR was merged into the 2.1 branch.
Commits
-------
1daefa5 [Routing] made it compatible with older PCRE version (pre 8)
Discussion
----------
[Routing] compatibility with older PCRE version (pre 8)
fixes#4093
Ok I changed my mind about this issue.
1. I figured more people are affected than I thought and CentOS is stubborn.
2. Symfony still uses the old regex style `?P<param>` in several other components. So also doing so in the routing makes it more consistent.
3. Even if it's definitely not good to use an over 6 year old PCRE version with a recent PHP version, we can still try to provide the best experience. It doesn't mean we support outdated software stacks of custom PHP compilations as we won't and cannot specifically test against it.
@fabpot: I will do a seperate PR on master when you merged this because the code changed alot in master so it cannot easily be merged I guess. I will also convert the symfony requirement for PCRE in the requirements check to a recommendation.