Merge pull request #1361 from dereuromark/master-form-helper-datetime

assert proper array access for _dateTimeSelected()
This commit is contained in:
Mark Story 2013-06-18 15:02:20 -07:00
commit 406b8b8ae1

View file

@ -2272,8 +2272,8 @@ class FormHelper extends AppHelper {
*/ */
protected function _dateTimeSelected($select, $fieldName, $attributes) { protected function _dateTimeSelected($select, $fieldName, $attributes) {
if ((empty($attributes['value']) || $attributes['value'] === true) && $value = $this->value($fieldName)) { if ((empty($attributes['value']) || $attributes['value'] === true) && $value = $this->value($fieldName)) {
if (is_array($value) && isset($value[$select])) { if (is_array($value)) {
$attributes['value'] = $value[$select]; $attributes['value'] = isset($value[$select]) ? $value[$select] : null;
} else { } else {
if (empty($value)) { if (empty($value)) {
if (!$attributes['empty']) { if (!$attributes['empty']) {