mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-06 12:51:58 +00:00
Use opendir instead of dir. Props nbachiyski. fixes #4450
git-svn-id: https://develop.svn.wordpress.org/trunk@5867 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -42,15 +42,15 @@ function get_plugins() {
|
||||
$plugin_root = ABSPATH . PLUGINDIR;
|
||||
|
||||
// Files in wp-content/plugins directory
|
||||
$plugins_dir = @ dir( $plugin_root);
|
||||
$plugins_dir = @ opendir( $plugin_root);
|
||||
if ( $plugins_dir ) {
|
||||
while (($file = $plugins_dir->read() ) !== false ) {
|
||||
while (($file = readdir( $plugins_dir ) ) !== false ) {
|
||||
if ( substr($file, 0, 1) == '.' )
|
||||
continue;
|
||||
if ( is_dir( $plugin_root.'/'.$file ) ) {
|
||||
$plugins_subdir = @ dir( $plugin_root.'/'.$file );
|
||||
$plugins_subdir = @ opendir( $plugin_root.'/'.$file );
|
||||
if ( $plugins_subdir ) {
|
||||
while (($subfile = $plugins_subdir->read() ) !== false ) {
|
||||
while (($subfile = readdir( $plugins_subdir ) ) !== false ) {
|
||||
if ( substr($subfile, 0, 1) == '.' )
|
||||
continue;
|
||||
if ( substr($subfile, -4) == '.php' )
|
||||
@@ -63,6 +63,8 @@ function get_plugins() {
|
||||
}
|
||||
}
|
||||
}
|
||||
@closedir( $plugins_dir );
|
||||
@closedir( $plugins_subdir );
|
||||
|
||||
if ( !$plugins_dir || !$plugin_files )
|
||||
return $wp_plugins;
|
||||
|
||||
@@ -1103,9 +1103,9 @@ function make_site_theme_from_default($theme_name, $template) {
|
||||
// Copy files from the default theme to the site theme.
|
||||
//$files = array('index.php', 'comments.php', 'comments-popup.php', 'footer.php', 'header.php', 'sidebar.php', 'style.css');
|
||||
|
||||
$theme_dir = @ dir("$default_dir");
|
||||
$theme_dir = @ opendir("$default_dir");
|
||||
if ($theme_dir) {
|
||||
while(($theme_file = $theme_dir->read()) !== false) {
|
||||
while(($theme_file = readdir( $theme_dir )) !== false) {
|
||||
if (is_dir("$default_dir/$theme_file"))
|
||||
continue;
|
||||
if (! @copy("$default_dir/$theme_file", "$site_dir/$theme_file"))
|
||||
@@ -1113,6 +1113,7 @@ function make_site_theme_from_default($theme_name, $template) {
|
||||
chmod("$site_dir/$theme_file", 0777);
|
||||
}
|
||||
}
|
||||
@closedir($theme_dir);
|
||||
|
||||
// Rewrite the theme header.
|
||||
$stylelines = explode("\n", implode('', file("$site_dir/style.css")));
|
||||
@@ -1136,9 +1137,9 @@ function make_site_theme_from_default($theme_name, $template) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$images_dir = @ dir("$default_dir/images");
|
||||
$images_dir = @ opendir("$default_dir/images");
|
||||
if ($images_dir) {
|
||||
while(($image = $images_dir->read()) !== false) {
|
||||
while(($image = readdir($images_dir)) !== false) {
|
||||
if (is_dir("$default_dir/images/$image"))
|
||||
continue;
|
||||
if (! @copy("$default_dir/images/$image", "$site_dir/images/$image"))
|
||||
@@ -1146,6 +1147,7 @@ function make_site_theme_from_default($theme_name, $template) {
|
||||
chmod("$site_dir/images/$image", 0777);
|
||||
}
|
||||
}
|
||||
@closedir($images_dir);
|
||||
}
|
||||
|
||||
// Create a site theme from the default theme.
|
||||
@@ -1232,4 +1234,4 @@ function maybe_disable_automattic_widgets() {
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user