From 0667ea8ac7519d7e642eade2686dc393d5faeae3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 25 Feb 2016 10:23:23 +0100 Subject: [PATCH] Use correct headers for json data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was previously not marked as such what could potentially lead to browsers doing some autodetection. Signed-off-by: Michal Čihař --- file_echo.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/file_echo.php b/file_echo.php index d910b74e28..031093ba1b 100644 --- a/file_echo.php +++ b/file_echo.php @@ -57,12 +57,16 @@ if (isset($_REQUEST['filename']) && isset($_REQUEST['image'])) { } else if (isset($_REQUEST['monitorconfig'])) { /* For monitor chart config export */ - PMA_downloadHeader('monitor.cfg', 'application/force-download'); + PMA_downloadHeader('monitor.cfg', 'application/json; charset=UTF-8'); + header('X-Content-Type-Options: nosniff'); + echo urldecode($_REQUEST['monitorconfig']); } else if (isset($_REQUEST['import'])) { /* For monitor chart config import */ - header('Content-type: text/plain'); + header('Content-Type: application/json; charset=UTF-8'); + header('X-Content-Type-Options: nosniff'); + if (!file_exists($_FILES['file']['tmp_name'])) { exit(); }