Changeset 6920

Show
Ignore:
Timestamp:
02/20/08 00:15:55 (7 months ago)
Author:
ryan
Message:

fs direct fixes from DD32. see #5586

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 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