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.
Built from https://develop.svn.wordpress.org/trunk@53460


git-svn-id: http://core.svn.wordpress.org/trunk@53049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2022-06-02 15:31:08 +00:00
parent e05a38f0a5
commit 1d2e969b50
2 changed files with 2 additions and 2 deletions

View File

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

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.1-alpha-53459'; $wp_version = '6.1-alpha-53460';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.