Skip to content

Regression introduced by #95 : ("Notice: Undefined offset: 0"). #96

@enthus1ast

Description

@enthus1ast

It seems my patch #95 introduced an regression: ("Notice: Undefined offset: 0"), when an uploaded file is absent in the form.
What seems to work for me is:

changeing this:

if (is_array($value)) {
    $value = implode(', ', array_map(function ($entry) {
      return $entry[0];
    }, $value));
}

to:

if (is_array($value)) {
    $value = implode(', ', array_map(function ($entry) {
      if (is_array($entry) and count($entry) > 0) {
        return $entry[0];
      }
    }, $value));
}

i move on and test on the way and if it works properly make another PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions