From 4bd135459bc6695e9b1000215983d56f00c1f519 Mon Sep 17 00:00:00 2001 From: Thomas Zilio Date: Thu, 28 Jun 2018 15:23:52 +0200 Subject: [PATCH] Fix content-type API --- api/index.php | 3 +++ core.php | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/api/index.php b/api/index.php index 3ce16569c..a78db90d2 100644 --- a/api/index.php +++ b/api/index.php @@ -9,6 +9,9 @@ function serverError() } } +// Impostazioni del Content-Type +header('Content-Type: application/json; charset=UTF-8'); + // Gestione degli errori set_error_handler('serverError'); register_shutdown_function('serverError'); diff --git a/core.php b/core.php index e09a64725..ad8e7ce93 100644 --- a/core.php +++ b/core.php @@ -1,9 +1,5 @@ validate()){ @@ -176,6 +175,7 @@ if (!API::isAPIRequest()) { // Registrazione globale del template per gli input HTML register_shutdown_function('translateTemplate'); + ob_start(); // Impostazione della sessione di base $_SESSION['infos'] = isset($_SESSION['infos']) ? array_unique($_SESSION['infos']) : [];