WordPress 4.2.4
[autoinstalls/wordpress.git] / wp-admin / includes / class-wp-upgrader.php
index acab417d3b55dc4ff604a9aa64c9dde4b86dba39..5d2370d090f732a37ba2205a5ad1022ea2961e94 100644 (file)
@@ -972,11 +972,14 @@ class Plugin_Upgrader extends WP_Upgrader {
 
                // Check the folder contains at least 1 valid plugin.
                $plugins_found = false;
-               foreach ( glob( $working_directory . '*.php' ) as $file ) {
-                       $info = get_plugin_data($file, false, false);
-                       if ( !empty( $info['Name'] ) ) {
-                               $plugins_found = true;
-                               break;
+               $files = glob( $working_directory . '*.php' );
+               if ( $files ) {
+                       foreach ( $files as $file ) {
+                               $info = get_plugin_data( $file, false, false );
+                               if ( ! empty( $info['Name'] ) ) {
+                                       $plugins_found = true;
+                                       break;
+                               }
                        }
                }