From cae1b671705b2bb0c17b631f187446134f258fd0 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 16 Nov 2005 03:27:22 +0000 Subject: [PATCH] Make sure plugins and themes are readable. Props Mike Little. fixes #1502 git-svn-id: https://develop.svn.wordpress.org/trunk@3103 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/admin-functions.php | 3 +++ wp-includes/functions.php | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index bd6f75216a..1a5603ccdd 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -1449,6 +1449,9 @@ function get_plugins() { sort($plugin_files); foreach ($plugin_files as $plugin_file) { + if ( !is_readable("$plugin_root/$plugin_file")) + continue; + $plugin_data = get_plugin_data("$plugin_root/$plugin_file"); if (empty ($plugin_data['Name'])) { diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 8c0becb8fc..9a64a87903 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1686,6 +1686,11 @@ function get_themes() { sort($theme_files); foreach($theme_files as $theme_file) { + if ( ! is_readable("$theme_root/$theme_file") ) { + $wp_broken_themes[$theme_file] = array('Name' => $theme_file, 'Title' => $theme_file, 'Description' => __('File not readable.')); + continue; + } + $theme_data = get_theme_data("$theme_root/$theme_file"); $name = $theme_data['Name'];