Check for the wp-admin/imports folder before we open it so we don't show notices when it isn't there.

git-svn-id: http://svn.automattic.com/wordpress/trunk@16996 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2010-12-16 10:20:12 +00:00
parent 67dca406aa
commit dc103571eb
1 changed files with 12 additions and 9 deletions

View File

@ -58,18 +58,21 @@ $parent_file = 'tools.php';
// Load all importers so that they can register. // Load all importers so that they can register.
$import_loc = 'wp-admin/import'; $import_loc = 'wp-admin/import';
$import_root = ABSPATH.$import_loc; $import_root = ABSPATH . $import_loc;
$imports_dir = @ opendir($import_root);
if ($imports_dir) { if ( file_exists( $import_root ) ) {
while (($file = readdir($imports_dir)) !== false) { $imports_dir = opendir($import_root);
if ($file[0] == '.') { if ($imports_dir) {
continue; while (($file = readdir($imports_dir)) !== false) {
} elseif (substr($file, -4) == '.php') { if ($file[0] == '.') {
require_once($import_root . '/' . $file); continue;
} elseif (substr($file, -4) == '.php') {
require_once($import_root . '/' . $file);
}
} }
} }
closedir( $imports_dir );
} }
@closedir($imports_dir);
$importers = get_importers(); $importers = get_importers();