You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"The getVar() method will pull from $_REQUEST, so will return any data from $_GET, $POST, or $_COOKIE."
This unexpectedly changes, sometimes it has the data sometimes it doesn't, seemingly for no reason...
CodeIgniter 4 version
v4.0.4
Affected module(s)
Incoming Request Class
Expected behavior, and steps to reproduce if appropriate
In a controller:
(the url contains GET parameter example.com?value=1)
request.getVar() should contain: value,1
public function index(){
$whatever = $this->request->getVar("value");
// $whatever should equal 1 but it is null (sometimes)
$thisworks = $this->request->getGet();
$whatever = $thisworks['value'];
// $whatever is equal to 1 (this always works)
}
Context
tested on windows 10 and ubuntu
The text was updated successfully, but these errors were encountered:
reedjones
added
the
bug
Verified issues on the current code behavior or pull requests that will fix them
label
Mar 12, 2021
It is hard to confirm this issue if it occurs "sometimes". You need to give us at least a reproducible test script that will imitate this occasional behavior. Otherwise, this cannot be considered as a real bug.
paulbalandan
added
waiting for info
Issues or pull requests that need further clarification from the author
and removed
bug
Verified issues on the current code behavior or pull requests that will fix them
labels
Mar 12, 2021
I did a quick test on the problem but everything seems to work fine, here is a related issue
It is hard to confirm this issue if it occurs "sometimes".
yeah that's the strange thing, in my project I have calls to getVar() all over the place, sometimes it fails, sometimes it doesn't, I had to basically go around the whole project and replace getVar with getGet..
I've noticed:
it seems to work if the var is in POST, doesn't work if the var is in GET
I can't seem to reproduce it on my local environment (windows ), only seems to happen on my server (linux)
I'll try to see if I can reproduce it locally and get more info
According to the docs:
This unexpectedly changes, sometimes it has the data sometimes it doesn't, seemingly for no reason...
CodeIgniter 4 version
v4.0.4
Affected module(s)
Incoming Request Class
Expected behavior, and steps to reproduce if appropriate
In a controller:
(the url contains GET parameter example.com?value=1)
request.getVar() should contain: value,1
Context
tested on windows 10 and ubuntu
The text was updated successfully, but these errors were encountered: