Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to upstream's RestController 3.1.5 #501

Merged
merged 2 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion application/plugins/rest_api/CREDITS
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

CodeIgniter Rest Server v3.1.4 <https://github.com/chriskacerguis/codeigniter-restserver>
CodeIgniter Rest Server v3.1.5 <https://github.com/chriskacerguis/codeigniter-restserver>
3 changes: 1 addition & 2 deletions application/plugins/rest_api/libraries/Format.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions application/plugins/rest_api/libraries/RestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
Expand Down
Loading