Skip to content

Commit 9dde475

Browse files
authored
Fix parsing multidimensional array from multipart (#186)
1 parent 7332946 commit 9dde475

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Arr.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,12 @@ public static function setMultipartArrayValue(array $array, string $name, $value
6565
return $array;
6666
}
6767

68+
$segment = substr($segment, 0, -1);
69+
6870
// If the segment is empty after trimming off the closing bracket, it means
6971
// we are at the end of the segment and are ready to set the value so we
7072
// can grab a pointer to the array location and set it after the loop.
71-
if (empty($segment = substr($segment, 0, -1))) {
73+
if ($segment === '') {
7274
$pointer = &$pointer[];
7375
} else {
7476
$pointer = &$pointer[$segment];

0 commit comments

Comments
 (0)