Make WordPress Core


Ignore:
Timestamp:
04/13/2009 04:11:02 PM (18 years ago)
Author:
ryan
Message:

WPFS cleanups. Props DD32. fixes #9525

File:
1 edited

Legend:

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

    r10150 r10919  
    170170        function getchmod($file) {
    171171                $dir = $this->dirlist($file);
    172                 return $dir[$file]['permsn'];
     172                return $this->getnumchmodfromh( $dir[basename($file)]['perms'] );
    173173        }
    174174        function group($file) {
    … …  
    188188        }
    189189
    190         function delete($file,$recursive=false) {
     190        function delete($file ,$recursive = false ) {
     191                if ( empty($file) )
     192                        return false;
    191193                if ( $this->is_file($file) )
    192194                        return @ftp_delete($this->link, $file);
    … …  
    322324
    323325        function dirlist($path = '.', $incdot = false, $recursive = false) {
    324                 if( $this->is_file($path) ) {
    325                         $limitFile = basename($path);
    326                         $path = dirname($path) . '/';
     326
     327                if ( substr($path, -1) !== '/') {
     328                        $limit = basename($path);
     329                        $path = trailingslashit(dirname($path));
    327330                } else {
    328                         $limitFile = false;
     331                        $limit = false;
    329332                }
    330333
    … …  
    340343                                continue;
    341344
    342                         if ( '.' == $entry["name"] || '..' == $entry["name"] )
     345                        if ( '.' == $entry['name'] || '..' == $entry['name'] )
     346                                continue;
     347
     348                        if ( $limit && $entry['name'] != $limit )
    343349                                continue;
    344350
Note: See TracChangeset for help on using the changeset viewer.