mirror of
git://develop.git.wordpress.org/
synced 2025-01-19 05:38:07 +01:00
Take out useless preg_match()'s and ignore directories starting with ".". Props m0n5t3r. fixes #4047
git-svn-id: https://develop.svn.wordpress.org/trunk@5152 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
158614b4aa
commit
fa0b7d4690
@ -1773,20 +1773,20 @@ function get_plugins() {
|
||||
$plugins_dir = @ dir( $plugin_root);
|
||||
if ( $plugins_dir ) {
|
||||
while (($file = $plugins_dir->read() ) !== false ) {
|
||||
if ( preg_match( '|^\.+$|', $file ))
|
||||
if ( substr($file, 0, 1) == '.' )
|
||||
continue;
|
||||
if ( is_dir( $plugin_root.'/'.$file ) ) {
|
||||
$plugins_subdir = @ dir( $plugin_root.'/'.$file );
|
||||
if ( $plugins_subdir ) {
|
||||
while (($subfile = $plugins_subdir->read() ) !== false ) {
|
||||
if ( preg_match( '|^\.+$|', $subfile ))
|
||||
if ( substr($subfile, 0, 1) == '.' )
|
||||
continue;
|
||||
if ( preg_match( '|\.php$|', $subfile ))
|
||||
if ( substr($subfile, -4) == '.php' )
|
||||
$plugin_files[] = "$file/$subfile";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ( preg_match( '|\.php$|', $file ))
|
||||
if ( substr($file, -4) == '.php' )
|
||||
$plugin_files[] = $file;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user