Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r15327 r17086  
    2121    '<p>' . __('In previous versions of WordPress, all the importers were built-in, but they have been turned into plugins as of version 3.0 since most people only use them once or infrequently.') . '</p>' .
    2222    '<p><strong>' . __('For more information:') . '</strong></p>' .
    23     '<p>' . __('<a href="http://codex.wordpress.org/Tools_Import_SubPanel" target="_blank">Import Documentation</a>') . '</p>' .
     23    '<p>' . __('<a href="http://codex.wordpress.org/Tools_Import_SubPanel" target="_blank">Documentation on Import</a>') . '</p>' .
    2424    '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
    2525);
     
    3838
    3939if ( ! empty( $_GET['invalid'] ) && !empty($popular_importers[$_GET['invalid']][3]) ) {
    40     wp_redirect("import.php?import=" . $popular_importers[$_GET['invalid']][3]);
     40    wp_redirect( admin_url('import.php?import=' . $popular_importers[$_GET['invalid']][3]) );
    4141    exit;
    4242}
    4343
    4444add_thickbox();
     45wp_enqueue_script( 'plugin-install' );
     46wp_admin_css( 'plugin-install' );
     47
    4548require_once ('admin-header.php');
    4649$parent_file = 'tools.php';
     
    5962// Load all importers so that they can register.
    6063$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);
     64$import_root = ABSPATH . $import_loc;
     65
     66if ( file_exists( $import_root ) ) {
     67    $imports_dir = opendir($import_root);
     68    if ($imports_dir) {
     69        while (($file = readdir($imports_dir)) !== false) {
     70            if ($file[0] == '.') {
     71                continue;
     72            } elseif (substr($file, -4) == '.php') {
     73                require_once($import_root . '/' . $file);
     74            }
    6975        }
    7076    }
     77    closedir( $imports_dir );
    7178}
    72 @closedir($imports_dir);
    7379
    7480$importers = get_importers();
     
    109115            }
    110116            if ( empty($action) )
    111                 $action = '<a href="' . esc_url(admin_url('plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug .
    112                                         '&from=import&TB_iframe=true&width=600&height=550')) . '" class="thickbox" title="' .
     117                $action = '<a href="' . esc_url( network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug .
     118                                        '&from=import&TB_iframe=true&width=600&height=550' ) ) . '" class="thickbox" title="' .
    113119                                        esc_attr__('Install importer') . '">' . $data[0] . '</a>';
    114120        } else {
     
    131137
    132138if ( current_user_can('install_plugins') )
    133     echo '<p>' . sprintf( __('If the importer you need is not listed, <a href="%s">search the plugins directory</a> to see if an importer is available.'), esc_url(admin_url('plugin-install.php?tab=search&type=tag&s=importer')) ) . '</p>';
     139    echo '<p>' . sprintf( __('If the importer you need is not listed, <a href="%s">search the plugins directory</a> to see if an importer is available.'), esc_url( network_admin_url( 'plugin-install.php?tab=search&type=tag&s=importer' ) ) ) . '</p>';
    134140?>
    135141
Note: See TracChangeset for help on using the changeset viewer.