Force download of export file in browsers that try to be too smart. Props mdawaffe. fixes #3225

git-svn-id: http://svn.automattic.com/wordpress/trunk@4477 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2006-11-18 01:27:22 +00:00
parent f9c7eadff4
commit a0dcbfac4e
1 changed files with 12 additions and 2 deletions

View File

@ -30,10 +30,20 @@ function export_wp() {
header('Content-Description: File Transfer'); header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream'); header('Content-Type: application/octet-stream');
header("Content-Disposition: attachment; filename=$filename"); header("Content-Disposition: attachment; filename=$filename");
header('Content-type: text/xml; charset=' . get_option('blog_charset'), true); header('Content-type: text/wxr+xml; charset=' . get_option('blog_charset'), true);
//$posts = query_posts(''); //$posts = query_posts('');
$posts = $wpdb->get_results("SELECT * FROM $wpdb->posts ORDER BY post_date_gmt ASC"); $posts = $wpdb->get_results("SELECT * FROM $wpdb->posts ORDER BY post_date_gmt ASC");
?> ?>
<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your blog. -->
<!-- It contains information about your blog's posts, comments, and categories. -->
<!-- You may use this file to transfer that content from one site to another. -->
<!-- To import this information into a WordPress blog, -->
<!-- 1. Log into that blog as an administrator -->
<!-- 2. Go to Manage: Import in the blog's admin panels -->
<!-- 3. Choose "WordPress" from the list -->
<!-- 4. Upload this file using the form provided on that page -->
<!-- You will be taken through the simple import procedure. -->
<!-- generator="wordpress/<?php bloginfo_rss('version') ?>" created="<?php echo date('Y-m-d H:m'); ?>"--> <!-- generator="wordpress/<?php bloginfo_rss('version') ?>" created="<?php echo date('Y-m-d H:m'); ?>"-->
<rss version="2.0" <rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
@ -105,4 +115,4 @@ if ( $comments ) { foreach ( $comments as $c ) { ?>
} }
include ('admin-footer.php'); include ('admin-footer.php');
?> ?>