Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
enthus1ast opened this issue Jan 27, 2022 · 0 comments
Open

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

enthus1ast opened this issue Jan 27, 2022 · 0 comments

Comments

@enthus1ast
Copy link
Contributor

enthus1ast commented Jan 27, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant