mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge pull request #1361 from dereuromark/master-form-helper-datetime
assert proper array access for _dateTimeSelected()
This commit is contained in:
commit
406b8b8ae1
1 changed files with 2 additions and 2 deletions
|
@ -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']) {
|
||||
|
|
Loading…
Reference in a new issue