X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/177fd6fefd2e3d5a0ea6591c71d660cabdb3c1a4..11be8dc178e77d0b46189bbd8e33a216a9b90942:/wp-admin/import/blogger.php diff --git a/wp-admin/import/blogger.php b/wp-admin/import/blogger.php index 0ea5727d..0879cd11 100644 --- a/wp-admin/import/blogger.php +++ b/wp-admin/import/blogger.php @@ -1,14 +1,51 @@

$title

$welcome

$prereqs

$stepone

+
+ ".screen_icon()." +

$title

+

$welcome

$prereqs

$stepone

@@ -31,7 +71,9 @@ class Blogger_Import { } function uh_oh($title, $message, $info) { - echo "

$title

$message

$info
"; + echo "
"; + screen_icon(); + echo "

$title

$message

$info
"; } function auth() { @@ -181,9 +223,10 @@ class Blogger_Import { $rows .= "$blogtitle{$blog['host']}$pstat$cstat\n"; } - echo "

$title

\n$rows
$name$url$posts$comments$action
"; + echo "

$title

\n$rows
$name$url$posts$comments$action
"; echo " \n"; } @@ -485,7 +529,7 @@ class Blogger_Import { } function import_post( $entry ) { - global $wpdb, $importing_blog; + global $importing_blog; // The old permalink is all Blogger gives us to link comments to their posts. if ( isset( $entry->draft ) ) @@ -506,7 +550,7 @@ class Blogger_Import { $post_status = isset( $entry->draft ) ? 'draft' : 'publish'; // Clean up content - $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content); + $post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content); $post_content = str_replace('
', '
', $post_content); $post_content = str_replace('
', '
', $post_content); @@ -559,7 +603,7 @@ class Blogger_Import { $comment_content = addslashes( $this->no_apos( html_entity_decode( $entry->content ) ) ); // Clean up content - $comment_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $comment_content); + $comment_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $comment_content); $comment_content = str_replace('
', '
', $comment_content); $comment_content = str_replace('
', '
', $comment_content); @@ -618,11 +662,11 @@ class Blogger_Import { foreach ( $blog['authors'] as $i => $author ) $rows .= ""; - return "

$heading

$blogtitle

$directions

$rows
$mapthis$tothis
"; + return "

$heading

$blogtitle

$directions

$rows
$mapthis$tothis
"; } function get_user_options($current) { - global $wpdb, $importer_users; + global $importer_users; if ( ! isset( $importer_users ) ) $importer_users = (array) get_users_of_blog(); @@ -641,7 +685,7 @@ class Blogger_Import { $host = $this->blogs[$importing_blog]['host']; // Get an array of posts => authors - $post_ids = (array) $wpdb->get_col("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = 'blogger_blog' AND meta_value = '$host'"); + $post_ids = (array) $wpdb->get_col( $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = 'blogger_blog' AND meta_value = %s", $host) ); $post_ids = join( ',', $post_ids ); $results = (array) $wpdb->get_results("SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = 'blogger_author' AND post_id IN ($post_ids)"); foreach ( $results as $row ) @@ -658,7 +702,7 @@ class Blogger_Import { $post_ids = (array) array_keys( $authors_posts, $this->blogs[$importing_blog]['authors'][$author][0] ); $post_ids = join( ',', $post_ids); - $wpdb->query("UPDATE $wpdb->posts SET post_author = $user_id WHERE id IN ($post_ids)"); + $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_author = %d WHERE id IN ($post_ids)", $user_id) ); $this->blogs[$importing_blog]['authors'][$author][1] = $user_id; } $this->save_vars(); @@ -777,7 +821,7 @@ class Blogger_Import { echo $result->get_error_message(); } elseif ( isset($_GET['token']) ) $this->auth(); - elseif ( $this->token && $this->token_is_valid() ) + elseif ( isset($this->token) && $this->token_is_valid() ) $this->show_blogs(); else $this->greet(); @@ -788,7 +832,7 @@ class Blogger_Import { $restart = __('Restart'); $message = __('We have saved some information about your Blogger account in your WordPress database. Clearing this information will allow you to start over. Restarting will not affect any posts you have already imported. If you attempt to re-import a blog, duplicate posts and comments will be skipped.'); $submit = __('Clear account information'); - echo "

$restart

$message

"; + echo "

$restart

$message

"; } }