Fix join_paths for absolute linux paths (#1715)

This commit is contained in:
Boy132 2025-09-17 12:35:20 +02:00 committed by GitHub
parent 932809fec5
commit ce393af7a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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