Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add Support to PUT and REQUEST data in Input Class

Added support to PUT data us gin $this->input->put() and REQUEST data
using $this->input->request()
  • Loading branch information...
commit 5e6fe40ea3e1307c7672270636a2e21652cb6e76 1 parent 6c94c2d
@hedcler authored
Showing with 32 additions and 0 deletions.
  1. +32 −0 system/core/Input.php
View
32 system/core/Input.php
@@ -176,6 +176,38 @@ public function get($index = NULL, $xss_clean = FALSE)
// --------------------------------------------------------------------
/**
+
+ /**
+ * Fetch an item from the PUT array
+ *
+ * @param string
+ * @param bool
+ * @return string
+ */
+ public function put($index = NULL, $xss_clean = FALSE)
+ {
+
+ parse_str(file_get_contents("php://input"),$_PUT);
+
+ // Check if a field has been provided
+ if ($index === NULL && ! empty($_PUT))
+ {
+ $put = array();
+
+ // Loop through the full _POST array and return it
+ foreach (array_keys($_PUT) as $key)
+ {
+ $put[$key] = $this->_fetch_from_array($_PUT, $key, $xss_clean);
+ }
+ return $put;
+ }
+
+ return $this->_fetch_from_array($_PUT, $index, $xss_clean);
+ }
+
+
+ // --------------------------------------------------------------------
+
* Fetch an item from the POST array
*
* @param string

0 comments on commit 5e6fe40

Please sign in to comment.
Something went wrong with that request. Please try again.