mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-30 18:24:31 +00:00
Nicer message for an uninstalled/invalid importer. see #13566.
git-svn-id: https://develop.svn.wordpress.org/trunk@14970 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -160,14 +160,13 @@ if ( isset($plugin_page) ) {
|
||||
if ( ! current_user_can('import') )
|
||||
wp_die(__('You are not allowed to import.'));
|
||||
|
||||
if ( validate_file($importer) ) {
|
||||
wp_die(__('Invalid importer.'));
|
||||
}
|
||||
if ( validate_file($importer) )
|
||||
wp_redirect( admin_url( 'import.php?invalid=' . $importer ) );
|
||||
|
||||
// Allow plugins to define importers as well
|
||||
if ( !isset($wp_importers) || !isset($wp_importers[$importer]) || ! is_callable($wp_importers[$importer][2])) {
|
||||
if (! file_exists(ABSPATH . "wp-admin/import/$importer.php"))
|
||||
wp_die(__('Cannot load importer.'));
|
||||
wp_redirect( admin_url( 'import.php?invalid=' . $importer ) );
|
||||
include(ABSPATH . "wp-admin/import/$importer.php");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user