Skip to content

Commit 8b8c0ba

Browse files
committed
Updated REST_Controller to use config_item('rest_limits_table') instead of hardcoded 'limits' (which causes an error if you use a different database table name)
1 parent c585b1b commit 8b8c0ba

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

application/libraries/REST_Controller.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ private function _check_limit($controller_method)
443443
if (!$result OR $result->hour_started < time() - (60 * 60))
444444
{
445445
// Right, set one up from scratch
446-
$this->rest->db->insert('limits', array(
446+
$this->rest->db->insert(config_item('rest_limits_table'), array(
447447
'uri' => $this->uri->uri_string(),
448448
'api_key' => isset($this->rest->key) ? $this->rest->key : '',
449449
'count' => 1,
@@ -464,7 +464,7 @@ private function _check_limit($controller_method)
464464
->where('uri', $this->uri->uri_string())
465465
->where('api_key', $this->rest->key)
466466
->set('count', 'count + 1', FALSE)
467-
->update(config_item('limits'));
467+
->update(config_item('rest_limits_table'));
468468
}
469469

470470
return TRUE;
@@ -897,4 +897,4 @@ private function _format_php($data = array())
897897
{
898898
return var_export($data, TRUE);
899899
}
900-
}
900+
}

0 commit comments

Comments
 (0)