Skip to content

Commit 67c6f66

Browse files
Merge pull request chriskacerguis#409 from darkwhispering/ci-input-class-conflict-fix
Fix for issue chriskacerguis#408
2 parents ca10105 + 95ff68c commit 67c6f66

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

application/libraries/REST_Controller.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,9 @@ protected function _parse_put()
961961

962962
// If no file type is provided, this is probably just arguments
963963
else {
964-
parse_str(file_get_contents('php://input'), $this->_put_args);
964+
if ($this->input->method() == 'put') {
965+
$this->_put_args = $this->input->input_stream();
966+
}
965967
}
966968

967969
}
@@ -1002,7 +1004,9 @@ protected function _parse_patch()
10021004

10031005
// If no file type is provided, this is probably just arguments
10041006
else {
1005-
parse_str(file_get_contents('php://input'), $this->_patch_args);
1007+
if ($this->input->method() == 'patch') {
1008+
$this->_patch_args = $this->input->input_stream();
1009+
}
10061010
}
10071011
}
10081012

@@ -1012,7 +1016,9 @@ protected function _parse_patch()
10121016
protected function _parse_delete()
10131017
{
10141018
// Set up out DELETE variables (which shouldn't really exist, but sssh!)
1015-
parse_str(file_get_contents('php://input'), $this->_delete_args);
1019+
if ($this->input->method() == 'delete') {
1020+
$this->_delete_args = $this->input->input_stream();
1021+
}
10161022
}
10171023

10181024
// INPUT FUNCTION --------------------------------------------------------------

0 commit comments

Comments
 (0)