Skip to content

Commit 103a31e

Browse files
committed
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: https://develop.svn.wordpress.org/trunk@16996 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 4db50ee commit 103a31e

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

wp-admin/import.php

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,21 @@
5858

5959
// Load all importers so that they can register.
6060
$import_loc = 'wp-admin/import';
61-
$import_root = ABSPATH.$import_loc;
62-
$imports_dir = @ opendir($import_root);
63-
if ($imports_dir) {
64-
while (($file = readdir($imports_dir)) !== false) {
65-
if ($file[0] == '.') {
66-
continue;
67-
} elseif (substr($file, -4) == '.php') {
68-
require_once($import_root . '/' . $file);
61+
$import_root = ABSPATH . $import_loc;
62+
63+
if ( file_exists( $import_root ) ) {
64+
$imports_dir = opendir($import_root);
65+
if ($imports_dir) {
66+
while (($file = readdir($imports_dir)) !== false) {
67+
if ($file[0] == '.') {
68+
continue;
69+
} elseif (substr($file, -4) == '.php') {
70+
require_once($import_root . '/' . $file);
71+
}
6972
}
7073
}
74+
closedir( $imports_dir );
7175
}
72-
@closedir($imports_dir);
7376

7477
$importers = get_importers();
7578

0 commit comments

Comments
 (0)