Make WordPress Core


Ignore:
Timestamp:
04/19/2009 07:36:28 PM (15 years ago)
Author:
ryan
Message:

consolidate plugin/theme/core upgrade/install functions. Props DD32. see #7875

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/plugin.php

    r11002 r11005  
    217217    // Files in wp-content/plugins directory
    218218    $plugins_dir = @ opendir( $plugin_root);
     219    $plugin_files = array();
    219220    if ( $plugins_dir ) {
    220221        while (($file = readdir( $plugins_dir ) ) !== false ) {
     
    240241    @closedir( $plugins_subdir );
    241242
    242     if ( !$plugins_dir || !$plugin_files )
     243    if ( !$plugins_dir || empty($plugin_files) )
    243244        return $wp_plugins;
    244245
     
    433434    }
    434435
    435     if ( $wp_filesystem->errors->get_error_code() ) {
    436         return $wp_filesystem->errors;
    437     }
    438 
    439436    if ( ! is_object($wp_filesystem) )
    440437        return new WP_Error('fs_unavailable', __('Could not access filesystem.'));
    441438
    442     if ( $wp_filesystem->errors->get_error_code() )
     439    if ( is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code() )
    443440        return new WP_Error('fs_error', __('Filesystem error'), $wp_filesystem->errors);
    444441
Note: See TracChangeset for help on using the changeset viewer.