Ticket #38292: 38292.2.patch
File 38292.2.patch, 1012 bytes (added by , 8 years ago) |
---|
-
wp-includes/class-wp-theme.php
1091 1091 1092 1092 $results = scandir( $path ); 1093 1093 $files = array(); 1094 1095 /** 1096 * Filters the array of excluded directories and files while scanning theme folder. 1097 * 1098 * @param array $exclusions An array of excluded directories and files. 1099 */ 1100 $exclusions = (array) apply_filters( 'theme_scandir_exclusions', array('CVS', 'node_modules') ); 1094 1101 1095 1102 foreach ( $results as $result ) { 1096 if ( '.' == $result[0] )1103 if ( '.' == $result[0] || in_array( $result, $exclusions) ) { 1097 1104 continue; 1105 } 1098 1106 if ( is_dir( $path . '/' . $result ) ) { 1099 if ( ! $depth || 'CVS' == $result)1107 if ( ! $depth ) 1100 1108 continue; 1101 1109 $found = self::scandir( $path . '/' . $result, $extensions, $depth - 1 , $relative_path . $result ); 1102 1110 $files = array_merge_recursive( $files, $found );