From 73d56f7a1a7e2aaf7cb00230af25ca208330ce6d Mon Sep 17 00:00:00 2001 From: Koen Kuipers Date: Thu, 27 Mar 2014 13:42:59 +0100 Subject: [PATCH] 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. --- src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php b/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php index 692f91e95c..83fe717f0d 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php @@ -166,7 +166,7 @@ class ChoiceType extends AbstractType $choices = null !== $options['choices'] ? $options['choices'] : array(); // 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])) { $choiceListCache[$hash] = new SimpleChoiceList($choices, $options['preferred_choices']);