[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_4-18347-g46c5bfc
Michal Čihař
nijel at users.sourceforge.net
Thu Sep 1 14:29:17 CEST 2011
The branch, master has been updated
via 46c5bfc01d60d1ebb638b591a595a0a877d139b8 (commit)
via 91fb4888e2012582605329abdb31069472375d54 (commit)
from e9dc6ff63e283ea5c20c36ed51fc8b33ec7f8a20 (commit)
- Log -----------------------------------------------------------------
commit 46c5bfc01d60d1ebb638b591a595a0a877d139b8
Author: Michal Čihař <michal at cihar.com>
Date: Thu Sep 1 14:29:03 2011 +0200
Fix transformation without download
commit 91fb4888e2012582605329abdb31069472375d54
Author: Michal Čihař <michal at cihar.com>
Date: Thu Sep 1 14:27:59 2011 +0200
Fix parameter order
-----------------------------------------------------------------------
Summary of changes:
libraries/core.lib.php | 7 +++++--
transformation_wrapper.php | 6 +-----
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/libraries/core.lib.php b/libraries/core.lib.php
index b4905c9..acedea4 100644
--- a/libraries/core.lib.php
+++ b/libraries/core.lib.php
@@ -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.
@@ -579,7 +580,9 @@ 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-Disposition: attachment; filename="' . $filename . '"');
+ }
header('Content-Type: ' . $mimetype);
header('Content-Transfer-Encoding: binary');
if ($length > 0) {
diff --git a/transformation_wrapper.php b/transformation_wrapper.php
index 1c5e16a..5d94c37 100644
--- a/transformation_wrapper.php
+++ b/transformation_wrapper.php
@@ -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];
hooks/post-receive
--
phpMyAdmin
More information about the Git
mailing list