Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
dc6b7e7b68
@ -564,7 +564,8 @@ function PMA_no_cache_header()
|
||||
/**
|
||||
* Sends header indicating file download.
|
||||
*
|
||||
* @param string $filename Filename to include in headers.
|
||||
* @param string $filename Filename to include in headers if empty,
|
||||
* none Content-Disposition header will be sent.
|
||||
* @param string $mimetype MIME type to include in headers.
|
||||
* @param int $length Length of content (optional)
|
||||
* @param bool $no_cache Whether to include no-caching headers.
|
||||
@ -578,8 +579,10 @@ function PMA_download_header($filename, $mimetype, $length = 0, $no_cache = true
|
||||
}
|
||||
/* Replace all possibly dangerous chars in filename */
|
||||
$filename = str_replace(array(';', '"', "\n", "\r"), '-', $filename);
|
||||
header('Content-Description: File Transfer');
|
||||
header('Content-Disposition: attachment; filename="' . $filename . '"');
|
||||
if (!empty($filename)) {
|
||||
header('Content-Description: File Transfer');
|
||||
header('Content-Disposition: attachment; filename="' . $filename . '"');
|
||||
}
|
||||
header('Content-Type: ' . $mimetype);
|
||||
header('Content-Transfer-Encoding: binary');
|
||||
if ($length > 0) {
|
||||
|
||||
@ -65,11 +65,7 @@ if (isset($ct) && !empty($ct)) {
|
||||
$mime_type = (isset($mime_map[$transform_key]['mimetype']) ? str_replace('_', '/', $mime_map[$transform_key]['mimetype']) : $default_ct) . (isset($mime_options['charset']) ? $mime_options['charset'] : '');
|
||||
}
|
||||
|
||||
if (empty($cn)) {
|
||||
$cn = 'download.bin';
|
||||
}
|
||||
|
||||
PMA_download_header($mime_type, $cn);
|
||||
PMA_download_header($cn, $mime_type);
|
||||
|
||||
if (! isset($resize)) {
|
||||
echo $row[$transform_key];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user