From 349e9f6dc7da0c44ee80d0a73963c1c5cef87131 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 26 Oct 2014 21:39:58 +0100 Subject: misc Signed-off-by: Florian Pritz --- application/core/MY_Controller.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'application/core/MY_Controller.php') diff --git a/application/core/MY_Controller.php b/application/core/MY_Controller.php index 22c1a9a1a..1e724a865 100644 --- a/application/core/MY_Controller.php +++ b/application/core/MY_Controller.php @@ -58,7 +58,11 @@ class MY_Controller extends CI_Controller { static_storage("response_type", "json"); } - if (static_storage("response_type") == "json" && ! in_array($this->uri->rsegment(2), $this->json_enabled_functions)) { + // TODO: this should probably call a function in the controller that does the checking + // instead of checking if the controller name == "api" + if (static_storage("response_type") == "json" + && $this->uri->segment(1) != "api" + && ! in_array($this->uri->rsegment(2), $this->json_enabled_functions)) { show_error("Function not JSON enabled"); } -- cgit v1.2.3-24-g4f1b