From e715f5358a2efc9ffe1086355b32de615aae09ce Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 17 Jul 2007 18:14:36 +0000 Subject: [PATCH] URL-encode the content-disposition suggested filename for XML export data. 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. --- includes/SpecialExport.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/SpecialExport.php b/includes/SpecialExport.php index 9822efa34c..12bd4d5c5b 100644 --- a/includes/SpecialExport.php +++ b/includes/SpecialExport.php @@ -133,7 +133,7 @@ function wfSpecialExport( $page = '' ) { 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 ); -- 2.20.1