Fixed bug in ChoiceType triggering a warning when not using utf-8
This fixes issue #10409 by not using json_encode anymore, but serialize instead.
This commit is contained in:
parent
f4ffd95713
commit
73d56f7a1a
@ -166,7 +166,7 @@ class ChoiceType extends AbstractType
|
|||||||
$choices = null !== $options['choices'] ? $options['choices'] : array();
|
$choices = null !== $options['choices'] ? $options['choices'] : array();
|
||||||
|
|
||||||
// Reuse existing choice lists in order to increase performance
|
// Reuse existing choice lists in order to increase performance
|
||||||
$hash = md5(json_encode(array($choices, $options['preferred_choices'])));
|
$hash = hash('sha256', serialize(array($choices, $options['preferred_choices'])));
|
||||||
|
|
||||||
if (!isset($choiceListCache[$hash])) {
|
if (!isset($choiceListCache[$hash])) {
|
||||||
$choiceListCache[$hash] = new SimpleChoiceList($choices, $options['preferred_choices']);
|
$choiceListCache[$hash] = new SimpleChoiceList($choices, $options['preferred_choices']);
|
||||||
|
Reference in New Issue
Block a user