Make WordPress Core


Ignore:
Timestamp:
07/27/2015 06:04:19 PM (11 years ago)
Author:
markjaquith
Message:

Don't blindly trust the output of glob() to be an array.

props kitchin
fixes #33093

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-upgrader.php

    r33209 r33447  
    10591059                // Check the folder contains at least 1 valid plugin.
    10601060                $plugins_found = false;
    1061                 foreach ( glob( $working_directory . '*.php' ) as $file ) {
    1062                         $info = get_plugin_data($file, false, false);
    1063                         if ( !empty( $info['Name'] ) ) {
    1064                                 $plugins_found = true;
    1065                                 break;
     1061                $files = glob( $working_directory . '*.php' );
     1062                if ( $files ) {
     1063                        foreach ( $files as $file ) {
     1064                                $info = get_plugin_data( $file, false, false );
     1065                                if ( ! empty( $info['Name'] ) ) {
     1066                                        $plugins_found = true;
     1067                                        break;
     1068                                }
    10661069                        }
    10671070                }
Note: See TracChangeset for help on using the changeset viewer.