mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-12 14:58:42 +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->uri->set($uri['uri']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->data = array_change_key_case($this->data, CASE_LOWER);
|
||||||
|
|
||||||
unset($_FILES);
|
unset($_FILES);
|
||||||
unset($_GET);
|
unset($_GET);
|
||||||
unset($_POST);
|
unset($_POST);
|
||||||
unset($_PUT);
|
unset($_REQUEST);
|
||||||
unset($_HEAD);
|
|
||||||
|
|
||||||
$this->path = explode('/', $this->uri->getPath());
|
$this->path = explode('/', $this->uri->getPath());
|
||||||
$this->l11n->setLanguage($this->path[0]);
|
$this->l11n->setLanguage($this->path[0]);
|
||||||
|
|
|
||||||
|
|
@ -175,6 +175,7 @@ abstract class RequestAbstract implements RequestInterface
|
||||||
*/
|
*/
|
||||||
public function getData($key = null)
|
public function getData($key = null)
|
||||||
{
|
{
|
||||||
|
$key = mb_strtolower($key);
|
||||||
return !isset($key) ? $this->data : $this->data[$key] ?? null;
|
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)
|
public function setData($key, $value, $overwrite = true)
|
||||||
{
|
{
|
||||||
|
$key = mb_strtolower($key);
|
||||||
if ($overwrite || !isset($this->data[$key])) {
|
if ($overwrite || !isset($this->data[$key])) {
|
||||||
$this->data[$key] = $value;
|
$this->data[$key] = $value;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user