11<?php defined ('BASEPATH ' ) OR exit ('No direct script access allowed ' );
22
3+ /**
4+ * REST_controller V 2.5.x
5+ *
6+ * @see https://github.com/philsturgeon/codeigniter-restserver
7+ *
8+ */
9+
310class REST_Controller extends CI_Controller {
411
512 protected $ rest_format = NULL ; // Set this in a controller to use a default format
@@ -20,7 +27,7 @@ class REST_Controller extends CI_Controller {
2027 'rawxml ' => 'application/xml ' ,
2128 'json ' => 'application/json ' ,
2229 'jsonp ' => 'application/javascript ' ,
23- 'serialize ' => 'application/vnd.php.serialized ' ,
30+ 'serialized ' => 'application/vnd.php.serialized ' ,
2431 'php ' => 'text/plain ' ,
2532 'html ' => 'text/html ' ,
2633 'csv ' => 'application/csv '
@@ -163,6 +170,11 @@ public function _remap($object_called, $arguments)
163170 // Get that useless shitty key out of here
164171 if (config_item ('rest_enable_keys ' ) AND $ use_key AND $ this ->_allow === FALSE )
165172 {
173+ if (config_item ('rest_enable_logging ' ) AND $ log_method )
174+ {
175+ $ this ->_log_request ();
176+ }
177+
166178 $ this ->response (array ('status ' => false , 'error ' => 'Invalid API Key. ' ), 403 );
167179 }
168180
@@ -519,7 +531,7 @@ protected function _check_limit($controller_method)
519531 else
520532 {
521533 // Your luck is out, you've called too many times!
522- if ($ result ->count > $ limit )
534+ if ($ result ->count >= $ limit )
523535 {
524536 return FALSE ;
525537 }
0 commit comments