Make sure plugins and themes are readable. Props Mike Little. fixes #1502
git-svn-id: http://svn.automattic.com/wordpress/trunk@3103 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b6f44dc532
commit
005dce9352
|
@ -1449,6 +1449,9 @@ function get_plugins() {
|
||||||
sort($plugin_files);
|
sort($plugin_files);
|
||||||
|
|
||||||
foreach ($plugin_files as $plugin_file) {
|
foreach ($plugin_files as $plugin_file) {
|
||||||
|
if ( !is_readable("$plugin_root/$plugin_file"))
|
||||||
|
continue;
|
||||||
|
|
||||||
$plugin_data = get_plugin_data("$plugin_root/$plugin_file");
|
$plugin_data = get_plugin_data("$plugin_root/$plugin_file");
|
||||||
|
|
||||||
if (empty ($plugin_data['Name'])) {
|
if (empty ($plugin_data['Name'])) {
|
||||||
|
|
|
@ -1686,6 +1686,11 @@ function get_themes() {
|
||||||
sort($theme_files);
|
sort($theme_files);
|
||||||
|
|
||||||
foreach($theme_files as $theme_file) {
|
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");
|
$theme_data = get_theme_data("$theme_root/$theme_file");
|
||||||
|
|
||||||
$name = $theme_data['Name'];
|
$name = $theme_data['Name'];
|
||||||
|
|
Loading…
Reference in New Issue