WordPress.org

Make WordPress Core

Changeset 6920


Ignore:
Timestamp:
02/20/2008 12:15:55 AM (13 years ago)
Author:
ryan
Message:

fs direct fixes from DD32. see #5586

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

Legend:

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

    r6919 r6920  
    33class WP_Filesystem_Direct{
    44    var $permission = null;
     5    var $errors = array();
    56    function WP_Filesystem_Direct($arg){
     7        $this->errors = new WP_Error();
    68        $this->permission = umask();
    79    }
     
    189191    function delete($file,$recursive=false){
    190192        $file = str_replace('\\','/',$file); //for win32, occasional problems deleteing files otherwise
     193
    191194        if( $this->is_file($file) )
    192195            return @unlink($file);
    193         if( !$recursive )
     196
     197        if( !$recursive && $this->is_dir($file) )
    194198            return @rmdir($file);
     199
    195200        $filelist = $this->dirlist($file);
     201        if( ! $filelist )
     202            return true; //No files exist, Say we've deleted them
    196203
    197204        $retval = true;
  • trunk/wp-admin/includes/update.php

    r6779 r6920  
    179179
    180180    // If plugin is in its own directory, recursively delete the directory.
    181     if ( '.' != $plugin_dir )
     181    if ( '.' != $plugin_dir && ABSPATH . PLUGINDIR != $plugin_dir )
    182182        $wp_filesystem->delete($plugin_dir, true);
    183183
Note: See TracChangeset for help on using the changeset viewer.