WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/07/2010 01:12:29 AM (12 years ago)
Author:
dd32
Message:

Fix recursive chmod for WP_Filesystem. Props reaperhulk for FtpExt. Fixes #11261

File:
1 edited

Legend:

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

    r12723 r12997  
    165165        }
    166166
    167         if ( ! $recursive || ! $this->is_dir($file) ) {
    168             return $this->ftp->chmod($file, $mode);
    169         }
    170 
    171         //Is a directory, and we want recursive
    172         $filelist = $this->dirlist($file);
    173         foreach ( $filelist as $filename )
    174             $this->chmod($file . '/' . $filename, $mode, $recursive);
    175 
    176         return true;
     167        // chmod any sub-objects if recursive.
     168        if ( $recursive && $this->is_dir($file) ) {
     169            $filelist = $this->dirlist($file);
     170            foreach ( (array)$filelist as $filename => $filemeta )
     171                $this->chmod($file . '/' . $filename, $mode, $recursive);
     172        }
     173
     174        // chmod the file or directory
     175        return $this->ftp->chmod($file, $mode);
    177176    }
    178177
Note: See TracChangeset for help on using the changeset viewer.