diff options
Diffstat (limited to 'application/core')
-rw-r--r-- | application/core/MY_Controller.php | 6 |
1 files changed, 5 insertions, 1 deletions
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"); } |