symfony/symfony — pull request #7926 by Tobion (2013-05-03 23:47:45+00:00)
Title: WIP [HttpFoundation] fix AcceptHeader::__toString() that did no sort the items

The items should be sorted before otherwise the string representation would depend on the order of method calls, e.g. if you called all() before __toString() or not.

When doing so I figured the sort algorithm does not work for items that have the same quality and index (as a test makes use of). Unfortunately it's not easily possible to fix as phps uasort() does not retain the array order even when returning 0.

@jfsimon cc