Make WordPress Core

Changeset 10930


Ignore:
Timestamp:
04/14/2009 05:16:44 PM (17 years ago)
Author:
ryan
Message:

Revert FTP parts of [10919]. fixes #9535 see #9525

Location:
trunk/wp-admin/includes
Files:
2 edited

Legend:

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

    r10919 r10930  
    170170        function getchmod($file) {
    171171                $dir = $this->dirlist($file);
    172                 return $this->getnumchmodfromh( $dir[basename($file)]['perms'] );
     172                return $dir[$file]['permsn'];
    173173        }
    174174        function group($file) {
    … …  
    188188        }
    189189
    190         function delete($file ,$recursive = false ) {
    191                 if ( empty($file) )
    192                         return false;
     190        function delete($file,$recursive=false) {
    193191                if ( $this->is_file($file) )
    194192                        return @ftp_delete($this->link, $file);
    … …  
    324322
    325323        function dirlist($path = '.', $incdot = false, $recursive = false) {
    326 
    327                 if ( substr($path, -1) !== '/') {
    328                         $limit = basename($path);
    329                         $path = trailingslashit(dirname($path));
     324                if( $this->is_file($path) ) {
     325                        $limitFile = basename($path);
     326                        $path = dirname($path) . '/';
    330327                } else {
    331                         $limit = false;
     328                        $limitFile = false;
    332329                }
    333330
    … …  
    343340                                continue;
    344341
    345                         if ( '.' == $entry['name'] || '..' == $entry['name'] )
    346                                 continue;
    347 
    348                         if ( $limit && $entry['name'] != $limit )
     342                        if ( '.' == $entry["name"] || '..' == $entry["name"] )
    349343                                continue;
    350344
  • trunk/wp-admin/includes/class-wp-filesystem-ftpsockets.php

    r10919 r10930  
    187187        function getchmod($file) {
    188188                $dir = $this->dirlist($file);
    189                 return $this->getnumchmodfromh( $dir[basename($file)]['perms'] );
     189                return $dir[$file]['permsn'];
    190190        }
    191191
    … …  
    282282
    283283        function dirlist($path = '.', $incdot = false, $recursive = false ) {
    284 
    285                 if ( substr($path, -1) !== '/') {
    286                         $limit = basename($path);
    287                         $path = trailingslashit(dirname($path));
     284                if( $this->is_file($path) ) {
     285                        $limitFile = basename($path);
     286                        $path = dirname($path) . '/';
    288287                } else {
    289                         $limit = false;
     288                        $limitFile = false;
    290289                }
    291290
    … …  
    293292                if( ! $list )
    294293                        return false;
    295 
    296294                if( empty($list) )
    297295                        return array();
    … …  
    299297                $ret = array();
    300298                foreach ( $list as $struc ) {
    301                         if ( $limit && $struc['name'] != $limit )
    302                                 continue;
    303299
    304300                        if ( 'd' == $struc['type'] ) {
Note: See TracChangeset for help on using the changeset viewer.