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-ftpsockets.php

    r55205 r55354  
    646646        }
    647647
    648         $ret = array();
     648        $path = trailingslashit( $path );
     649        $ret  = array();
    649650
    650651        foreach ( $list as $struc ) {
     
    664665            if ( 'd' === $struc['type'] ) {
    665666                if ( $recursive ) {
    666                     $struc['files'] = $this->dirlist( $path . '/' . $struc['name'], $include_hidden, $recursive );
     667                    $struc['files'] = $this->dirlist( $path . $struc['name'], $include_hidden, $recursive );
    667668                } else {
    668669                    $struc['files'] = array();
Note: See TracChangeset for help on using the changeset viewer.