diff --git a/html/includes/forms/parse-alert-map.inc.php b/html/includes/forms/parse-alert-map.inc.php index 8ded88953..877ad16ca 100644 --- a/html/includes/forms/parse-alert-map.inc.php +++ b/html/includes/forms/parse-alert-map.inc.php @@ -11,9 +11,9 @@ * option) any later version. Please see LICENSE.txt at the top level of * the source code distribution for details. */ -header('Content-type: application/json'); if (is_admin() === false) { + header('Content-type: text/plain'); die('ERROR: You need to be admin'); } @@ -32,5 +32,6 @@ if (is_numeric($map_id) && $map_id > 0) { 'rule' => $map['name'], 'target' => $map['target'], ); + header('Content-type: application/json'); echo _json_encode($output); } diff --git a/html/includes/forms/parse-alert-rule.inc.php b/html/includes/forms/parse-alert-rule.inc.php index 376776acd..4372303bf 100644 --- a/html/includes/forms/parse-alert-rule.inc.php +++ b/html/includes/forms/parse-alert-rule.inc.php @@ -11,9 +11,9 @@ * option) any later version. Please see LICENSE.txt at the top level of * the source code distribution for details. */ -header('Content-type: application/json'); if (is_admin() === false) { + header('Content-type: text/plain'); die('ERROR: You need to be admin'); } @@ -30,5 +30,6 @@ if (is_numeric($alert_id) && $alert_id > 0) { 'name' => $rule['name'], 'rules' => $rule_split, ); + header('Content-type: application/json'); echo _json_encode($output); } diff --git a/html/includes/forms/parse-alert-template.inc.php b/html/includes/forms/parse-alert-template.inc.php index 08eb2ba1b..dd04ec575 100644 --- a/html/includes/forms/parse-alert-template.inc.php +++ b/html/includes/forms/parse-alert-template.inc.php @@ -11,9 +11,9 @@ * option) any later version. Please see LICENSE.txt at the top level of * the source code distribution for details. */ -header('Content-type: application/json'); if (is_admin() === false) { + header('Content-type: text/plain'); die('ERROR: You need to be admin'); } @@ -27,5 +27,6 @@ if (is_numeric($template_id) && $template_id > 0) { 'title' => $template['title'], 'title_rec' => $template['title_rec'], ); + header('Content-type: application/json'); echo _json_encode($output); }