r24209 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24208‎ | r24209 | r24210 >
Date:18:14, 17 July 2007
Author:brion
Status:old
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/includes/SpecialExport.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialExport.php
@@ -133,7 +133,7 @@
134134 header( "Content-type: application/xml; charset=utf-8" );
135135 if( $wgRequest->getCheck( 'wpDownload' ) ) {
136136 // Provide a sane filename suggestion
137 - $filename = $wgSitename . '-' . wfTimestampNow() . '.xml';
 137+ $filename = urlencode( $wgSitename . '-' . wfTimestampNow() . '.xml' );
138138 $wgRequest->response()->header( "Content-disposition: attachment;filename={$filename}" );
139139 }
140140 $pages = explode( "\n", $page );

Follow-up revisions

RevisionCommit summaryAuthorDate
r24215Merged revisions 24095-24212 via svnmerge from...david21:19, 17 July 2007

Status & tagging log