This fixes the filename encoding for non-pure-ASCII site names on IE 6/7, and may fix issues with other ASCIIish chars.
Safari 2/Mac messes up the filename either way, but percent codes are probably still better here than garbage characters. :)
IE/Mac and Safari 3/Win don't appear to pay attention to the content-disposition and still show the XML inline.
header( "Content-type: application/xml; charset=utf-8" );
if( $wgRequest->getCheck( 'wpDownload' ) ) {
// Provide a sane filename suggestion
- $filename = $wgSitename . '-' . wfTimestampNow() . '.xml';
+ $filename = urlencode( $wgSitename . '-' . wfTimestampNow() . '.xml' );
$wgRequest->response()->header( "Content-disposition: attachment;filename={$filename}" );
}
$pages = explode( "\n", $page );