mirror of
https://github.com/pelican-dev/panel.git
synced 2025-09-08 06:18:48 +02:00
trim first, then filter
This commit is contained in:
parent
8c6490bc2c
commit
b6e991053d
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user