diff options
author | Theo Chatzimichos <tampakrap@gentoo.org> | 2012-06-13 16:18:13 +0200 |
---|---|---|
committer | Theo Chatzimichos <tampakrap@gentoo.org> | 2012-06-13 16:18:13 +0200 |
commit | ab05ecf6ac2bdd10e542eff7764de0f02a17f0a8 (patch) | |
tree | 5134afa67836f0657151a40cfba49c9adf969a50 /plugins/wordpress-importer/wordpress-importer.php | |
parent | Update limit-login-attempts, smart-youtube and wp-stats (diff) | |
download | blogs-gentoo-ab05ecf6ac2bdd10e542eff7764de0f02a17f0a8.tar.gz blogs-gentoo-ab05ecf6ac2bdd10e542eff7764de0f02a17f0a8.tar.bz2 blogs-gentoo-ab05ecf6ac2bdd10e542eff7764de0f02a17f0a8.zip |
New module jetpack, replacement of wp-stats
Update akismet, limit-login-attempts, smart-youtube, wp-importer
Diffstat (limited to 'plugins/wordpress-importer/wordpress-importer.php')
-rw-r--r-- | plugins/wordpress-importer/wordpress-importer.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/plugins/wordpress-importer/wordpress-importer.php b/plugins/wordpress-importer/wordpress-importer.php index 5e384844..f0abbda2 100644 --- a/plugins/wordpress-importer/wordpress-importer.php +++ b/plugins/wordpress-importer/wordpress-importer.php @@ -5,7 +5,7 @@ Plugin URI: http://wordpress.org/extend/plugins/wordpress-importer/ Description: Import posts, pages, comments, custom fields, categories, tags and more from a WordPress export file. Author: wordpressdotorg Author URI: http://wordpress.org/ -Version: 0.5 +Version: 0.6 Text Domain: wordpress-importer License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html */ @@ -36,7 +36,7 @@ require dirname( __FILE__ ) . '/parsers.php'; */ if ( class_exists( 'WP_Importer' ) ) { class WP_Import extends WP_Importer { - var $max_wxr_version = 1.1; // max. supported WXR version + var $max_wxr_version = 1.2; // max. supported WXR version var $id; // WXR attachment ID @@ -194,6 +194,11 @@ class WP_Import extends WP_Importer { echo '<p><strong>' . __( 'Sorry, there has been an error.', 'wordpress-importer' ) . '</strong><br />'; echo esc_html( $file['error'] ) . '</p>'; return false; + } else if ( ! file_exists( $file['file'] ) ) { + echo '<p><strong>' . __( 'Sorry, there has been an error.', 'wordpress-importer' ) . '</strong><br />'; + printf( __( 'The export file could not be found at <code>%s</code>. It is likely that this was caused by a permissions problem.', 'wordpress-importer' ), esc_html( $file['file'] ) ); + echo '</p>'; + return false; } $this->id = (int) $file['id']; @@ -335,7 +340,7 @@ class WP_Import extends WP_Importer { $create_users = $this->allow_create_users(); foreach ( (array) $_POST['imported_authors'] as $i => $old_login ) { - // Multsite adds strtolower to sanitize_user. Need to sanitize here to stop breakage in process_posts. + // Multisite adds strtolower to sanitize_user. Need to sanitize here to stop breakage in process_posts. $santized_old_login = sanitize_user( $old_login, true ); $old_id = isset( $this->authors[$old_login]['author_id'] ) ? intval($this->authors[$old_login]['author_id']) : false; @@ -539,7 +544,7 @@ class WP_Import extends WP_Importer { $post_type_object = get_post_type_object( $post['post_type'] ); $post_exists = post_exists( $post['post_title'], '', $post['post_date'] ); - if ( $post_exists ) { + if ( $post_exists && get_post_type( $post_exists ) == $post['post_type'] ) { printf( __('%s “%s” already exists.', 'wordpress-importer'), $post_type_object->labels->singular_name, esc_html($post['post_title']) ); echo '<br />'; $comment_post_ID = $post_id = $post_exists; |