Make WordPress Core


Ignore:
Timestamp:
02/16/2023 10:11:32 PM (2 years ago)
Author:
azaozz
Message:

Filesystem API: Use trailingslashit( $path ) instead of $path . '/'. Fixes a warning when $path already ends with a slash.

Props: costdev, afragen, mukesh27.
Fixes: #57516.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-filesystem-ftpext.php

    r55205 r55354  
    762762        }
    763763
    764         $ret = array();
     764        $path = trailingslashit( $path );
     765        $ret  = array();
    765766
    766767        foreach ( (array) $dirlist as $struc ) {
    767768            if ( 'd' === $struc['type'] ) {
    768769                if ( $recursive ) {
    769                     $struc['files'] = $this->dirlist( $path . '/' . $struc['name'], $include_hidden, $recursive );
     770                    $struc['files'] = $this->dirlist( $path . $struc['name'], $include_hidden, $recursive );
    770771                } else {
    771772                    $struc['files'] = array();
Note: See TracChangeset for help on using the changeset viewer.