mirror of
https://github.com/pelican-dev/panel.git
synced 2025-09-20 16:44:54 +02:00
Fix join_paths
for absolute linux paths (#1715)
This commit is contained in:
parent
932809fec5
commit
ce393af7a6
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user