mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 09:48:40 +00:00
Removing super globals+case insensitiv get
This commit is contained in:
parent
1abd8c271a
commit
95a390f701
|
|
@ -132,11 +132,12 @@ class Request extends RequestAbstract
|
|||
$this->uri->set($uri['uri']);
|
||||
}
|
||||
|
||||
$this->data = array_change_key_case($this->data, CASE_LOWER);
|
||||
|
||||
unset($_FILES);
|
||||
unset($_GET);
|
||||
unset($_POST);
|
||||
unset($_PUT);
|
||||
unset($_HEAD);
|
||||
unset($_REQUEST);
|
||||
|
||||
$this->path = explode('/', $this->uri->getPath());
|
||||
$this->l11n->setLanguage($this->path[0]);
|
||||
|
|
|
|||
|
|
@ -175,6 +175,7 @@ abstract class RequestAbstract implements RequestInterface
|
|||
*/
|
||||
public function getData($key = null)
|
||||
{
|
||||
$key = mb_strtolower($key);
|
||||
return !isset($key) ? $this->data : $this->data[$key] ?? null;
|
||||
}
|
||||
|
||||
|
|
@ -183,6 +184,7 @@ abstract class RequestAbstract implements RequestInterface
|
|||
*/
|
||||
public function setData($key, $value, $overwrite = true)
|
||||
{
|
||||
$key = mb_strtolower($key);
|
||||
if ($overwrite || !isset($this->data[$key])) {
|
||||
$this->data[$key] = $value;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user