PHP Version
8.0
CodeIgniter4 Version
4.1.2
CodeIgniter4 Installation Method
Manual (zip or tar.gz)
Which operating systems have you tested for this bug?
Linux
Which server did you use?
apache
Database
No response
What happened?
If "null" is sent to the server and when trying to get data through "Services :: request () -> getVar('myKey')", the error "Argument 2 passed to dot_array_search () must be of the type array..."
Steps to Reproduce
I am sending a POST request without data
Expected Output
Services :: request () -> getVar ('myKey') function should return "null"
Anything else?
File:
system/HTTP/IncomingRequest.php
public function getJsonVar()
Line 540: $data = dot_array_search($index, $this->getJSON(true));
if $this->getJSON(true) returns null then an error appears
Solution:
$getJson = $this->getJSON(true) ?: [];
$data = dot_array_search($index, $getJson);
PHP Version
8.0
CodeIgniter4 Version
4.1.2
CodeIgniter4 Installation Method
Manual (zip or tar.gz)
Which operating systems have you tested for this bug?
Linux
Which server did you use?
apache
Database
No response
What happened?
If "null" is sent to the server and when trying to get data through "Services :: request () -> getVar('myKey')", the error "Argument 2 passed to dot_array_search () must be of the type array..."
Steps to Reproduce
I am sending a POST request without data
Expected Output
Services :: request () -> getVar ('myKey') function should return "null"
Anything else?
File:
system/HTTP/IncomingRequest.php
public function getJsonVar()Line 540:
$data = dot_array_search($index, $this->getJSON(true));if
$this->getJSON(true)returns null then an error appearsSolution: