Skip to content
Browse files

assert proper array access for _dateTimeSelected()

  • Loading branch information...
1 parent 111bfa4 commit eb13242680731f8c1cf82786670f5fe40d06f6f3 @dereuromark dereuromark committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/Cake/View/Helper/FormHelper.php
View
4 lib/Cake/View/Helper/FormHelper.php
@@ -2272,8 +2272,8 @@ public function minute($fieldName, $attributes = array()) {
*/
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']) {

0 comments on commit eb13242

Please sign in to comment.
Something went wrong with that request. Please try again.