From 54d5d869ad2c525dd276f28a8409658a106d9e3f Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Wed, 4 Sep 2013 14:56:06 +0200 Subject: Generalize request_type() to static_storage() Signed-off-by: Florian Pritz --- application/core/MY_Controller.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'application/core') diff --git a/application/core/MY_Controller.php b/application/core/MY_Controller.php index 312b0f763..e1c6cc96e 100644 --- a/application/core/MY_Controller.php +++ b/application/core/MY_Controller.php @@ -35,16 +35,16 @@ class MY_Controller extends CI_Controller { // TODO: proper accept header handling or is this enough? if (isset($_SERVER["HTTP_ACCEPT"])) { if ($_SERVER["HTTP_ACCEPT"] == "application/json") { - request_type("json"); + static_storage("response_type", "json"); } } // Allow for easier testing in browser if ($this->input->get("json") !== false) { - request_type("json"); + static_storage("response_type", "json"); } - if (request_type() == "json" && ! in_array($this->uri->rsegment(2), $this->json_enabled_functions)) { + if (static_storage("response_type") == "json" && ! in_array($this->uri->rsegment(2), $this->json_enabled_functions)) { show_error("Function not JSON enabled"); } -- cgit v1.2.3-24-g4f1b