Browse Source

Merge branch '2.2'

Rachman Chavik 13 years ago
parent
commit
1cb24384cd

+ 1 - 1
lib/Cake/Test/Case/View/Helper/FormHelperTest.php

@@ -4246,7 +4246,7 @@ class FormHelperTest extends CakeTestCase {
 			'Contact' => array(),
 			'ContactTag' => array(
 				array(
-					'id' => 1,
+					'id' => '1',
 					'name' => 'blue'
 				),
 				array(

+ 2 - 1
lib/Cake/View/Helper/FormHelper.php

@@ -2613,9 +2613,10 @@ class FormHelper extends AppHelper {
 			}
 
 			if ($name !== null) {
+				$isNumeric = is_numeric($name);
 				if (
 					(!$selectedIsArray && !$selectedIsEmpty && (string)$attributes['value'] == (string)$name) ||
-					($selectedIsArray && in_array($name, $attributes['value'], true))
+					($selectedIsArray && in_array($name, $attributes['value'], !$isNumeric))
 				) {
 					if ($attributes['style'] === 'checkbox') {
 						$htmlOptions['checked'] = true;