From eb13242680731f8c1cf82786670f5fe40d06f6f3 Mon Sep 17 00:00:00 2001 From: euromark Date: Tue, 18 Jun 2013 09:39:43 +0200 Subject: [PATCH] assert proper array access for _dateTimeSelected() --- lib/Cake/View/Helper/FormHelper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Cake/View/Helper/FormHelper.php b/lib/Cake/View/Helper/FormHelper.php index b3bff1032..d3a1481cc 100644 --- a/lib/Cake/View/Helper/FormHelper.php +++ b/lib/Cake/View/Helper/FormHelper.php @@ -2272,8 +2272,8 @@ class FormHelper extends AppHelper { */ protected function _dateTimeSelected($select, $fieldName, $attributes) { if ((empty($attributes['value']) || $attributes['value'] === true) && $value = $this->value($fieldName)) { - if (is_array($value) && isset($value[$select])) { - $attributes['value'] = $value[$select]; + if (is_array($value)) { + $attributes['value'] = isset($value[$select]) ? $value[$select] : null; } else { if (empty($value)) { if (!$attributes['empty']) {