diff options
author | Florian Pritz <bluewind@xinu.at> | 2014-10-26 21:39:58 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2015-01-16 17:38:38 +0100 |
commit | 349e9f6dc7da0c44ee80d0a73963c1c5cef87131 (patch) | |
tree | ecde4a60e67e4de5c40f4d11db5d49ef3c1df9ca /application/core | |
parent | d59962443687127ea1defc2f8ac41af1c2c02fe4 (diff) |
misc
Signed-off-by: Florian Pritz <bluewind@xinu.at>
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"); } |