Skip to content

Commit d105a8f

Browse files
committed
🔨 modify requests to global array variable
Signed-off-by: otengkwame <[email protected]>
1 parent ffb825b commit d105a8f

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

CodeIgniter/Framework/core/Input.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,16 +264,18 @@ public function post($index = null, $xss_clean = false)
264264
return $this->_fetch_from_array($_POST, $index, $xss_clean);
265265
}
266266

267+
// --------------------------------------------------------------------
268+
267269
/**
268-
* Verify if an item from the POST array exists
270+
* Verify if an item from the REQUEST array exists
269271
*
270272
* @param mixed $index Index for item to be checked from $_POST
271273
* @param bool $xss_clean Whether to apply XSS filtering
272274
* @return bool
273275
*/
274276
public function has($index = null, $xss_clean = false)
275277
{
276-
$exists = $this->_fetch_from_array($_POST, $index, $xss_clean);
278+
$exists = $this->_fetch_from_array($_REQUEST, $index, $xss_clean);
277279

278280
if ($exists) {
279281
return true;
@@ -283,27 +285,29 @@ public function has($index = null, $xss_clean = false)
283285
}
284286

285287
/**
286-
* Fetch only items from the POST array
288+
* Fetch only items from the REQUEST array
287289
*
288290
* @param mixed $indexes Indexes for item to be fetched from $_POST
289291
* @param bool $xss_clean Whether to apply XSS filtering
290292
* @return mixed
291293
*/
292294
public function only(array $indexes = [], $xss_clean = false)
293295
{
294-
return $this->_fetch_from_array($_POST, $indexes, $xss_clean);
296+
return $this->_fetch_from_array($_REQUEST, $indexes, $xss_clean);
295297
}
296298

299+
// --------------------------------------------------------------------
300+
297301
/**
298-
* Fetch all except items given form the POST array
302+
* Fetch all except items given form the REQUEST array
299303
*
300304
* @param array $indexes
301305
* @param bool $xss_clean
302306
* @return void
303307
*/
304308
public function except(array $indexes = [], $xss_clean = false)
305309
{
306-
$post = array_diff_key($_POST, array_flip($indexes));
310+
$post = array_diff_key($_REQUEST, array_flip($indexes));
307311

308312
return $this->_fetch_from_array($post, null, $xss_clean);
309313
}

0 commit comments

Comments
 (0)