Merge pull request #22 from phpmyadmin/json-response

Use correct headers for json data
This commit is contained in:
Michal Čihař 2016-02-25 12:32:45 +01:00
commit 25a632a9f4

View File

@ -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();
}