WordPress.org

Make WordPress Core

Ticket #6834: file-php-more-verbose-error.patch

File file-php-more-verbose-error.patch, 885 bytes (added by plankers, 7 years ago)

Patch for more verbose errors for plugin updater

  • wp-admin/includes/file.php

     
    259259                        $tmppath .= $path[$j] . '/'; 
    260260                        if ( ! $fs->is_dir($to . $tmppath) ) 
    261261                                if ( !$fs->mkdir($to . $tmppath, 0755) ) 
    262                                         return new WP_Error('mkdir_failed', __('Could not create directory')); 
     262                                        return new WP_Error('mkdir_failed', __("Could not create directory: $to$tmppath")); 
    263263                } 
    264264 
    265265                // We've made sure the folders are there, so let's extract the file now: 
    266266                if ( ! $file['folder'] ) 
    267267                        if ( !$fs->put_contents( $to . $file['filename'], $file['content']) ) 
    268                                 return new WP_Error('copy_failed', __('Could not copy file')); 
     268                                return new WP_Error('copy_failed', __("Could not copy file to $to")); 
    269269                        $fs->chmod($to . $file['filename'], 0644); 
    270270        } 
    271271