Skip to content

Commit

Permalink
Merge pull request #65 from zkwbbr/2.x
Browse files Browse the repository at this point in the history
Make sure only arrays are passed in foreach()
  • Loading branch information
harikt authored Mar 4, 2024
2 parents 35d5444 + 40a50d1 commit ec13a00
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Request/Files.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,11 @@ protected function init($src, &$tgt)
}
} else {
// not a target, create sub-elements and init them too
foreach ($src as $key => $val) {
$tgt[$key] = array();
$this->init($val, $tgt[$key]);
if (is_array($src)) {
foreach ($src as $key => $val) {
$tgt[$key] = array();
$this->init($val, $tgt[$key]);
}
}
}
}
Expand Down

0 comments on commit ec13a00

Please sign in to comment.