Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Adjuste code to maintain Codeigniter Syntax Style.

  • Loading branch information...
commit 4626d59909ea9967dd34ade44caf0e4da702aa90 1 parent 41558b1
Hedcler Morais authored

Showing 1 changed file with 18 additions and 22 deletions. Show diff stats Hide diff stats

  1. +18 22 system/core/Input.php
40 system/core/Input.php
@@ -200,12 +200,16 @@ public function get($index = NULL, $xss_clean = FALSE)
200 200 * @return string
201 201 */
202 202
203   - public function put($index = NULL, $xss_clean = FALSE) {
204   -
205   - if ( $this->server('REQUEST_METHOD') != 'PUT' ) return FALSE;
206   -
  203 + public function put($index = NULL, $xss_clean = FALSE)
  204 + {
  205 + // Check if HTTP METHOD is PUT
  206 + if ( $this->server('REQUEST_METHOD') != 'PUT' )
  207 + {
  208 + return FALSE;
  209 + }
  210 + // Read PUT variables
207 211 parse_str( file_get_contents("php://input"), $this->http_put_data );
208   -
  212 + // Check if a field has been provided
209 213 if ($index === NULL && !empty($this->http_put_data))
210 214 {
211 215 $put = array();
@@ -217,12 +221,8 @@ public function put($index = NULL, $xss_clean = FALSE) {
217 221 return $put;
218 222 }
219 223
220   -<<<<<<< HEAD
221 224 return $this->_fetch_from_array($this->http_put_data, $index, $xss_clean);
222 225
223   -=======
224   - return $this->_fetch_from_array($_REQUEST, $index, $xss_clean);
225   ->>>>>>> Correct Arrays
226 226 }
227 227
228 228
@@ -236,33 +236,29 @@ public function put($index = NULL, $xss_clean = FALSE) {
236 236 * @return string
237 237 */
238 238
239   - public function delete($index = NULL, $xss_clean = FALSE) {
240   -
241   - if ( $this->server('REQUEST_METHOD') != 'DELETE' ) return FALSE;
242   -
  239 + public function delete($index = NULL, $xss_clean = FALSE)
  240 + {
  241 + // Check if HTTP METHOD is DELETE
  242 + if ($this->server('REQUEST_METHOD') != 'DELETE')
  243 + {
  244 + return FALSE;
  245 + }
  246 + // Read DELETE variables
243 247 parse_str( file_get_contents("php://input"), $this->http_delete_data );
244   -
  248 + // Check if a field has been provided
245 249 if ($index === NULL && !empty($this->http_delete_data))
246 250 {
247 251 $put = array();
248 252 // Loop through the full delete args array and return it
249 253 foreach (array_keys($this->http_delete_data) as $key)
250 254 {
251   -<<<<<<< HEAD
252 255 $put[$key] = $this->_fetch_from_array($this->http_delete_data, $key, $xss_clean);
253   -=======
254   - $put[$key] = $this->_fetch_from_array($_PUT, $key, $xss_clean);
255   ->>>>>>> Correct Arrays
256 256 }
257 257 return $put;
258 258 }
259 259
260   -<<<<<<< HEAD
261 260 return $this->_fetch_from_array($this->http_delete_data, $index, $xss_clean);
262 261
263   -=======
264   - return $this->_fetch_from_array($_PUT, $index, $xss_clean);
265   ->>>>>>> Correct Arrays
266 262 }
267 263
268 264

0 comments on commit 4626d59

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