Skip to content

Commit

Permalink
added an additional filter to remove empty array items (#10803)
Browse files Browse the repository at this point in the history
* ENH Added filter to remove empty/null from Path::join parts

This is to ensure null values are removed and trim() deprecated warnings are not thrown
Fixes #10802

* FIX revert public signature

Co-authored-by: Steve Boyd <[email protected]>

---------

Co-authored-by: Steve Boyd <[email protected]>
  • Loading branch information
josephlewisnz and emteknetnz authored Jun 14, 2023
1 parent 6fd7694 commit b6a3e3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Core/Path.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static function join(...$parts)
}

// Cleanup and join all parts
$parts = array_filter(array_map('trim', $parts ?? []));
$parts = array_filter(array_map('trim', array_filter($parts ?? [])));
$fullPath = static::normalise(implode(DIRECTORY_SEPARATOR, $parts));

// Protect against directory traversal vulnerability (OTG-AUTHZ-001)
Expand Down

0 comments on commit b6a3e3a

Please sign in to comment.