Permalink
Browse files

Strict in_array for mixed id variable types

Setting the in_array check to strict, as this would return true
incorrectly when and if values are of mixed type.
  • Loading branch information...
1 parent 689745d commit 84b10ba70790a1e23abf89728ee154f86461ca15 @jhnlsn jhnlsn committed Jan 17, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Cake/View/Helper/FormHelper.php
@@ -2471,7 +2471,7 @@ protected function _selectOptions($elements = array(), $parents = array(), $show
if ($name !== null) {
if (
(!$selectedIsArray && !$selectedIsEmpty && (string)$attributes['value'] == (string)$name) ||
- ($selectedIsArray && in_array($name, $attributes['value']))
+ ($selectedIsArray && in_array($name, $attributes['value'], true))
) {
if ($attributes['style'] === 'checkbox') {
$htmlOptions['checked'] = true;

0 comments on commit 84b10ba

Please sign in to comment.