summaryrefslogtreecommitdiffstats
path: root/application/core/MY_Controller.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2013-09-04 14:56:06 +0200
committerFlorian Pritz <bluewind@xinu.at>2013-09-04 14:56:06 +0200
commit54d5d869ad2c525dd276f28a8409658a106d9e3f (patch)
treede619bb4824b61d41b0452a94fc850cc28b27e35 /application/core/MY_Controller.php
parent720808fc3884a415dc483b50796697a095d1b5b8 (diff)
Generalize request_type() to static_storage()
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/core/MY_Controller.php')
-rw-r--r--application/core/MY_Controller.php6
1 files changed, 3 insertions, 3 deletions
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");
}