From 5f66aba55ece15e04e5aaf9a0302ab943c269c5d Mon Sep 17 00:00:00 2001 From: nacin Date: Thu, 27 May 2010 02:03:06 +0000 Subject: [PATCH] Nicer message for an uninstalled/invalid importer. see #13566. git-svn-id: http://svn.automattic.com/wordpress/trunk@14970 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin.php | 7 +++---- wp-admin/import.php | 3 +++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/wp-admin/admin.php b/wp-admin/admin.php index 101000e87a..1932caf888 100644 --- a/wp-admin/admin.php +++ b/wp-admin/admin.php @@ -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"); } diff --git a/wp-admin/import.php b/wp-admin/import.php index bfeb3d59f2..525140626e 100644 --- a/wp-admin/import.php +++ b/wp-admin/import.php @@ -31,6 +31,9 @@ $parent_file = 'tools.php';

+ +

%s importer is invalid or is not installed.'), esc_html( $_GET['invalid'] ) ); ?>

+