Make WordPress Core

Changeset 53460


Ignore:
Timestamp:
06/02/2022 03:29:26 PM (4 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r53426 r53460  
    21332133        }
    21342134
    2135         return rtrim( $base, '/' ) . '/' . ltrim( $path, '/' );
     2135        return rtrim( $base, '/' ) . '/' . $path;
    21362136}
    21372137
Note: See TracChangeset for help on using the changeset viewer.