Skip to content

Commit 26458c7

Browse files
author
Phil Sturgeon
committed
Fixed PUT parameters and added defaults for $this->rest->key and other properties.
1 parent 31fa918 commit 26458c7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

application/libraries/REST_Controller.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function __construct()
7474
$this->request->body = file_get_contents('php://input');
7575

7676
// Try and set up our PUT variables anyway in case its not
77-
parse_str(file_get_contents('php://input'), $this->_put_args);
77+
parse_str($this->request->body, $this->_put_args);
7878
break;
7979

8080
case 'delete':
@@ -306,12 +306,15 @@ private function _detect_api_key()
306306
// Work out the name of the SERVER entry based on config
307307
$key_name = 'HTTP_'.strtoupper(str_replace('-', '_', config_item('rest_key_name')));
308308

309+
$this->rest->key = NULL;
310+
$this->rest->level = NULL;
311+
$this->rest->ignore_limits = FALSE;
312+
309313
// Find the key from server or arguments
310314
if ($key = isset($this->_args['API-Key']) ? $this->_args['API-Key'] : $this->input->server($key_name))
311315
{
312316
if ( ! $row = $this->rest->db->where('key', $key)->get('keys')->row())
313317
{
314-
var_dump($this->rest->db->last_query());
315318
return FALSE;
316319
}
317320

0 commit comments

Comments
 (0)