trim first, then filter

This commit is contained in:
Boy132 2025-09-05 14:01:50 +02:00
parent 8c6490bc2c
commit b6e991053d

View File

@ -52,8 +52,8 @@ if (!function_exists('convert_bytes_to_readable')) {
if (!function_exists('join_paths')) {
function join_paths(string $base, string ...$paths): string
{
$paths = array_filter($paths, fn (string $path) => strlen($path) > 0);
$paths = array_map(fn (string $path) => trim($path, '/'), $paths);
$paths = array_filter($paths, fn (string $path) => strlen($path) > 0);
if (empty($base) || $base === '/') {
return implode('/', $paths);