Revert "fix: add null coalescing for undefined superglobals"

This reverts commit 847a0d51f0.
pull/664/head
KnifeLemon 3 weeks ago
parent a1e1c5010a
commit 144327da78

@ -177,10 +177,10 @@ class Request
'user_agent' => $this->getVar('HTTP_USER_AGENT'), 'user_agent' => $this->getVar('HTTP_USER_AGENT'),
'type' => $this->getVar('CONTENT_TYPE'), 'type' => $this->getVar('CONTENT_TYPE'),
'length' => intval($this->getVar('CONTENT_LENGTH', 0)), 'length' => intval($this->getVar('CONTENT_LENGTH', 0)),
'query' => new Collection($_GET ?? []), 'query' => new Collection($_GET),
'data' => new Collection($_POST ?? []), 'data' => new Collection($_POST),
'cookies' => new Collection($_COOKIE ?? []), 'cookies' => new Collection($_COOKIE),
'files' => new Collection($_FILES ?? []), 'files' => new Collection($_FILES),
'secure' => $scheme === 'https', 'secure' => $scheme === 'https',
'accept' => $this->getVar('HTTP_ACCEPT'), 'accept' => $this->getVar('HTTP_ACCEPT'),
'proxy_ip' => $this->getProxyIpAddress(), 'proxy_ip' => $this->getProxyIpAddress(),
@ -219,7 +219,7 @@ class Request
$this->url = '/'; $this->url = '/';
} else { } else {
// Merge URL query parameters with $_GET // Merge URL query parameters with $_GET
$_GET = array_merge($_GET ?? [], self::parseQuery($this->url)); $_GET = array_merge($_GET, self::parseQuery($this->url));
$this->query->setData($_GET); $this->query->setData($_GET);
} }
@ -546,7 +546,7 @@ class Request
$contentType = strtolower(trim($this->type)); $contentType = strtolower(trim($this->type));
$isMultipart = strpos($contentType, 'multipart/form-data') === 0; $isMultipart = strpos($contentType, 'multipart/form-data') === 0;
$boundary = null; $boundary = null;
if ($isMultipart) { if ($isMultipart) {
// Extract boundary more safely // Extract boundary more safely
if (preg_match('/boundary=(["\']?)([^"\';,\s]+)\1/i', $this->type, $matches)) { if (preg_match('/boundary=(["\']?)([^"\';,\s]+)\1/i', $this->type, $matches)) {

Loading…
Cancel
Save