Merge pull request #2936 from pblasquez/pblasquez-application_json_patch

application/json headers
This commit is contained in:
Neil Lathwood 2016-02-05 10:14:28 +00:00
commit e884e72ca8
5 changed files with 5 additions and 3 deletions

View File

@ -55,5 +55,5 @@ $response = array(
'html' => $output,
'title' => $title,
);
header('Content-type: application/json');
echo _json_encode($response);

View File

@ -29,6 +29,7 @@ if (!$_SESSION['authenticated']) {
if (preg_match('/^[a-zA-Z0-9\-]+$/', $_POST['type']) == 1) {
if (file_exists('includes/forms/'.$_POST['type'].'.inc.php')) {
header('Content-type: application/json');
include_once 'includes/forms/'.$_POST['type'].'.inc.php';
}
}

View File

@ -62,7 +62,7 @@ function levsort($base, $obj) {
}
header('Content-type: application/json');
$obj = array(array('name' => 'Error: No suggestions found.'));
$term = array();
$current = false;

View File

@ -19,7 +19,7 @@ $bgp = array();
if (isset($_REQUEST['search'])) {
$search = mres($_REQUEST['search']);
header('Content-type: application/json');
if (strlen($search) > 0) {
$found = 0;

View File

@ -36,6 +36,7 @@ $response = array();
if (isset($id)) {
if (file_exists("includes/table/$id.inc.php")) {
header('Content-type: application/json');
include_once "includes/table/$id.inc.php";
}
}