merged branch jakzal/yamlDoubleQuotesDumperFix (PR #4320)

Commits
-------

b631073 [Yaml] Fixed double quotes escaping in Dumper.

Discussion
----------

[Yaml] Fixed double quotes escaping in Dumper

Issue #4308 is caused by Dumper::escapeWithDoubleQuotes() which uses [str_replace()](http://php.net/str_replace).

From the php docs:

> Because str_replace() replaces left to right, it might replace a previously inserted value when doing multiple replacements.

We should be very careful in deciding about the order of elements in $escapees array. I'd really appreciate if someone reviewed my fix. Tests say I didn't break anything but I'm not sure what percentage of Yaml specification is covered by tests.

Bug fix: yes
Feature addition: no
Backwards compatibility break: not that I know
Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/jakzal/symfony.png?branch=yamlDoubleQuotesDumperFix)](http://travis-ci.org/jakzal/symfony)
Fixes the following tickets: #4308

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

by travisbot at 2012-05-18T08:53:51Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1364279) (merged 5192722c into a04acc89).

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

by travisbot at 2012-05-18T23:19:49Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1371539) (merged ecaa1aab into fc3c609b).

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

by dinamic at 2012-05-19T07:35:21Z

Something is really wrong with this method. You can see clearly that multiple characters would fail proper escaping.

Here's an example:
```
$value = '\\\\"some value\n \"some quoted string\" and \'some single quotes one\'"';
var_dump(Escaper::escapeWithDoubleQuotes($value));
string(72) ""\\\"some value\n \\some quoted string\\ and 'some single quotes one'\"""
```

To begin with the backslash - in the initial value you have 2 (escaped ones), that after escaping should result in 4, not in 1 (escaped). I guess this behavior has to be verified with the importer, but imho it does not seem right.

Does anyone know why this escaping wasn't done using a regular expression in first place?

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

by clemens-tolboom at 2012-05-19T10:18:58Z

Searching for https://duckduckgo.com/?q=what+is+\xc2\x85 the table on http://stackoverflow.com/questions/6609895/efficiently-replace-bad-characters is interesting enough to decide we need way more documentation on this file.

\xc2\x85 seems to be triple dot (ellipses)
\xe2\x80\xa9 seems to be paragraph separator see http://drupal.org/node/914360#comment-3468550

Conflicts:
	src/Symfony/Component/Yaml/Escaper.php
updated CHANGELOG for 2.1.3
update CONTRIBUTORS for 2.1.3
updated VERSION for 2.1.3
bumped Symfony version to 2.1.4-DEV
[2.1][HttpFoundation] Fixed Php doc in Request::get
[Form] Adapted HTML5 format in DateTimeType as response to a closed ICU ticket
merged branch bschussek/datetimeimpr (PR #5896)

This PR was merged into the 2.1 branch.

Commits
-------

a0af8bf [Form] Adapted HTML5 format in DateTimeType as response to a closed ICU ticket

Discussion
----------

[Form] Adapted HTML5 format in DateTimeType as response to a closed ICU ticket

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: -
merged branch lyrixx/fix-request-get (PR #5894)

This PR was merged into the 2.1 branch.

Commits
-------

b9f6cac [2.1][HttpFoundation] Fixed Php doc in Request::get

Discussion
----------

[2.1][HttpFoundation] Fixed Php doc in Request::get

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT

According to php code, `Request::get` method does not seek in cookies.

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

by pborreli at 2012-11-02T11:02:26Z

your PR is full of reSquest typo :)

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

by lyrixx at 2012-11-02T11:25:31Z

@pborreli Fixed
removed unused use statements
Merge branch '2.1'

* 2.1:
  removed unused use statements
  [Form] Adapted HTML5 format in DateTimeType as response to a closed ICU ticket
  [2.1][HttpFoundation] Fixed Php doc in Request::get
  bumped Symfony version to 2.1.4-DEV
  updated VERSION for 2.1.3
  update CONTRIBUTORS for 2.1.3
  updated CHANGELOG for 2.1.3
  merged branch jakzal/yamlDoubleQuotesDumperFix (PR #4320)

Conflicts:
	src/Symfony/Component/HttpKernel/Kernel.php
removed unused use statements
[http-foudation] Better accept header parsing
merged branch jfsimon/accept-header-parsing (PR #5841)

This PR was squashed before being merged into the master branch (closes #5841).

Commits
-------

6b601bd [http-foudation] Better accept header parsing

Discussion
----------

[http-foudation] Better accept header parsing

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

**Quality:**
The special `q` item attribute represents its quality. I had to make some choices:
*  if I set `q` attribute, it's assigned to quality property, but not to attributes
*  the `__toString()` method only render `q` attribute if quality is less than 1

**BC break:**
The return of `Request::splitHttpAcceptHeader()` has changed. It's result was an array of qualities indexed by an accept value, it now returns an array of `AcceptHeaderItem` indexed by its value.

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

by jfsimon at 2012-10-26T08:35:55Z

As dicussed in https://github.com/symfony/symfony/pull/5711.

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

by Seldaek at 2012-10-27T10:35:49Z

Maybe you can pull https://github.com/Seldaek/symfony/commit/5e8a5267f67428e18fa6dc38cccefd9f3ca9738f into your branch (for some reason I can't send a PR to your repo, it doesn't show up in github's repo selector.. looks like they don't like projects with too many forks). It allows you to use usort() which hopefully is faster than your merge sort, though I did not bench it. I also added tests to confirm the functionality.

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

by Seldaek at 2012-10-27T10:40:27Z

Sorry please check https://github.com/Seldaek/symfony/commit/376dd93c569362a162bd2e79c7eea115ac5e355e instead, I missed a few tests in the RequestTest class.

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

by jfsimon at 2012-10-29T16:26:03Z

@fabpot do you think the introduced BC break is acceptable?

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

by fabpot at 2012-10-29T16:37:06Z

@jfsimon Are all getAccept*() method BC?

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

by jfsimon at 2012-10-29T16:39:26Z

@fabpot nope, just `Request::splitHttpAcceptHeader()`

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

by jfsimon at 2012-10-29T16:43:18Z

@fabpot I think missunderstood... only `Request::splitHttpAcceptHeader()` breaks BC.

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

by fabpot at 2012-10-29T16:53:22Z

So, a BC break on just splitHttpAcceptHeader is possible... but should be documented properly. Another option would be to deprecate the current method (and keep it as is), and just use the new version everywhere. Sounds better as it won"t introduce any BC breaks.

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

by jfsimon at 2012-10-29T16:55:57Z

@fabpot Okay, I'll update this PR according to your second option.

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

by jfsimon at 2012-10-29T20:14:46Z

@fabpot done.

As you can see here: https://github.com/symfony/symfony/pull/5841/files#L5L1029 value returned by `Request::splitHttpAcceptHeader()` is not **exactly** the same as before because all attributes are present (not only those before the `q` one).

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

by fabpot at 2012-10-30T06:16:23Z

The last thing missing before I can merge is a PR to update the documentation (should probably be just a note somewhere with the example you have in the UPGRADE file).

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

by jfsimon at 2012-10-30T07:07:08Z

@fabpot I could add this example here: http://symfony.com/doc/current/components/http_foundation/introduction.html#request after `Accessing the session`, what do you think?

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

by fabpot at 2012-10-30T07:14:10Z

Yes, looks good to me.