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

git-svn-id: https://develop.svn.wordpress.org/trunk@4477 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2006-11-18 01:27:22 +00:00
parent a9df0b834b
commit b973ee2e7d
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-Type: application/octet-stream');
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 = $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'); ?>"-->
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
@ -105,4 +115,4 @@ if ( $comments ) { foreach ( $comments as $c ) { ?>
}
include ('admin-footer.php');
?>
?>