diff --git a/application/plugins/rest_api/CREDITS b/application/plugins/rest_api/CREDITS index e9e68daf..e79c3637 100644 --- a/application/plugins/rest_api/CREDITS +++ b/application/plugins/rest_api/CREDITS @@ -1,2 +1,2 @@ -CodeIgniter Rest Server v3.1.4 +CodeIgniter Rest Server v3.1.5 diff --git a/application/plugins/rest_api/libraries/Format.php b/application/plugins/rest_api/libraries/Format.php index dc8772ad..153d8bf6 100644 --- a/application/plugins/rest_api/libraries/Format.php +++ b/application/plugins/rest_api/libraries/Format.php @@ -7,7 +7,7 @@ * Help convert between various formats such as XML, JSON, CSV, etc. * * @author Phil Sturgeon, Chris Kacerguis, @softwarespot - * @license http://www.dbad-license.org/ + * @license MIT (See LICENSE) */ class Format { @@ -179,7 +179,6 @@ public function to_xml($data = null, $structure = null, $basenode = 'xml') } foreach ($data as $key => $value) { - //change false/true to 0/1 if (is_bool($value)) { $value = (int) $value; diff --git a/application/plugins/rest_api/libraries/RestController.php b/application/plugins/rest_api/libraries/RestController.php index 8c7d3869..80c7a5e7 100644 --- a/application/plugins/rest_api/libraries/RestController.php +++ b/application/plugins/rest_api/libraries/RestController.php @@ -703,7 +703,7 @@ public function response($data = null, $http_code = null, $continue = false) } } ob_end_flush(); - // Otherwise dump the output automatically + // Otherwise dump the output automatically } else { echo json_encode($data); } @@ -872,13 +872,13 @@ protected function _detect_api_key() $this->rest->ignore_limits = false; // Find the key from server or arguments - if (($key = isset($this->_args[$api_key_variable]) ? $this->_args[$api_key_variable] : $this->input->server($key_name))) { + if ($key = isset($this->_args[$api_key_variable]) ? $this->_args[$api_key_variable] : $this->input->server($key_name)) { + $this->rest->key = $key; + if (!($row = $this->rest->db->where($this->config->item('rest_key_column'), $key)->get($this->config->item('rest_keys_table'))->row())) { return false; } - $this->rest->key = $row->{$this->config->item('rest_key_column')}; - isset($row->user_id) && $this->rest->user_id = $row->user_id; isset($row->level) && $this->rest->level = $row->level; isset($row->ignore_limits) && $this->rest->ignore_limits = $row->ignore_limits;