Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Čihař <mcihar@suse.cz>2011-08-04 17:19:29 +0400
committerMichal Čihař <mcihar@suse.cz>2011-08-04 17:19:29 +0400
commitbffad989158bcf15409399ee5623d3611fb2f128 (patch)
tree174ddc477e050330a91ed859d2fde66809fc895b /file_echo.php
parent6c92b02f81c2296382d60bd66653d296628e926e (diff)
Separate data decoding from output
Diffstat (limited to 'file_echo.php')
-rw-r--r--file_echo.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/file_echo.php b/file_echo.php
index 2add078633..2756209252 100644
--- a/file_echo.php
+++ b/file_echo.php
@@ -39,16 +39,20 @@ if (isset($_REQUEST['filename']) && isset($_REQUEST['image'])) {
$filename = $_REQUEST['filename'];
}
- /* Send download header */
- PMA_download_header($filename, $_REQUEST['type']);
-
- /* Send data */
+ /* Decode data */
if ($extension != 'svg') {
- echo base64_decode(substr($_REQUEST['image'], strpos($_REQUEST['image'],',') + 1));
+ $data = substr($_REQUEST['image'], strpos($_REQUEST['image'],',') + 1);
+ $data = base64_decode($data);
} else {
- echo $_REQUEST['image'];
+ $data = $_REQUEST['image'];
}
+ /* Send download header */
+ PMA_download_header($filename, $_REQUEST['type'], strlen($data));
+
+ /* Send data */
+ echo $data;
+
} else if (isset($_REQUEST['monitorconfig'])) {
PMA_download_header('monitor.cfg', 'application/force-download');
echo urldecode($_REQUEST['monitorconfig']);