General: Remove redundant ltrim() from path_join().

If the path starts with a slash, it will be considered absolute and returned as is earlier in the function.

It it's not absolute, then it does not start with a slash, so there is nothing to trim.

This change is covered by existing unit tests.

Follow-up to [6984], [53457].

Props karlijnbk.
See #55897.

git-svn-id: https://develop.svn.wordpress.org/trunk@53460 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2022-06-02 15:29:26 +00:00
parent ab3848ae12
commit 27963429a1

View File

@@ -2132,7 +2132,7 @@ function path_join( $base, $path ) {
return $path;
}
return rtrim( $base, '/' ) . '/' . ltrim( $path, '/' );
return rtrim( $base, '/' ) . '/' . $path;
}
/**