assert proper array access for _dateTimeSelected()

This commit is contained in:
euromark 2013-06-18 09:39:43 +02:00
parent 111bfa43d4
commit eb13242680

View file

@ -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']) {