WordPress.org

Make WordPress Core

Changeset 14970


Ignore:
Timestamp:
05/27/10 02:03:06 (4 years ago)
Author:
nacin
Message:

Nicer message for an uninstalled/invalid importer. see #13566.

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin.php

    r14759 r14970  
    161161        wp_die(__('You are not allowed to import.')); 
    162162 
    163     if ( validate_file($importer) ) { 
    164         wp_die(__('Invalid importer.')); 
    165     } 
     163    if ( validate_file($importer) ) 
     164        wp_redirect( admin_url( 'import.php?invalid=' . $importer ) ); 
    166165 
    167166    // Allow plugins to define importers as well 
    168167    if ( !isset($wp_importers) || !isset($wp_importers[$importer]) || ! is_callable($wp_importers[$importer][2])) { 
    169168        if (! file_exists(ABSPATH . "wp-admin/import/$importer.php")) 
    170             wp_die(__('Cannot load importer.')); 
     169            wp_redirect( admin_url( 'import.php?invalid=' . $importer ) ); 
    171170        include(ABSPATH . "wp-admin/import/$importer.php"); 
    172171    } 
  • trunk/wp-admin/import.php

    r14969 r14970  
    3232<?php screen_icon(); ?> 
    3333<h2><?php echo esc_html( $title ); ?></h2> 
     34<?php if ( ! empty( $_GET['invalid'] ) ) : ?> 
     35    <div class="error"><p><strong><?php _e('ERROR:')?></strong> <?php printf( __('The <strong>%s</strong> importer is invalid or is not installed.'), esc_html( $_GET['invalid'] ) ); ?></p></div> 
     36<?php endif; ?> 
    3437<p><?php _e('If you have posts or comments in another system, WordPress can import those into this site. To get started, choose a system to import from below:'); ?></p> 
    3538 
Note: See TracChangeset for help on using the changeset viewer.