Make WordPress Core


Ignore:
Timestamp:
04/13/2009 04:11:02 PM (17 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-ftpsockets.php

    r8990 r10919  
    187187    function getchmod($file) {
    188188        $dir = $this->dirlist($file);
    189         return $dir[$file]['permsn'];
     189        return $this->getnumchmodfromh( $dir[basename($file)]['perms'] );
    190190    }
    191191
     
    282282
    283283    function dirlist($path = '.', $incdot = false, $recursive = false ) {
    284         if( $this->is_file($path) ) {
    285             $limitFile = basename($path);
    286             $path = dirname($path) . '/';
     284
     285        if ( substr($path, -1) !== '/') {
     286            $limit = basename($path);
     287            $path = trailingslashit(dirname($path));
    287288        } else {
    288             $limitFile = false;
     289            $limit = false;
    289290        }
    290291
     
    292293        if( ! $list )
    293294            return false;
     295
    294296        if( empty($list) )
    295297            return array();
     
    297299        $ret = array();
    298300        foreach ( $list as $struc ) {
     301            if ( $limit && $struc['name'] != $limit )
     302                continue;
    299303
    300304            if ( 'd' == $struc['type'] ) {
Note: See TracChangeset for help on using the changeset viewer.