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
fix: make getVar() read merged superglobals instead of stale $_REQUEST
$_REQUEST is populated only once at the start of the request, so it
becomes stale when SiteURIFactory updates $_GET during URI parsing.
getVar() previously read the stale $_REQUEST, breaking withRequest()
for GET parameters.
Instead of mutating $_REQUEST (the approach rejected in #10205), this
change makes getVar() return a merged view of $_GET, $_POST, and
$_COOKIE according to request_order, leaving $_REQUEST untouched.
- Add Superglobals::getRequestData() returning the merged data.
- Extract RequestTrait::fetchFromArray() to reuse the filtering logic.
- Update getVar() to use getRequestData() + fetchFromArray().
- Revert the SiteURIFactory syncRequest() calls.
- Update tests.
Fixes#9872
$this->assertSame('code=good', $_SERVER['QUERY_STRING']); // @phpstan-ignore codeigniter.superglobalsOffsetAccess (checks the live superglobal, not the snapshot service)
258
258
$this->assertSame(['code' => 'good'], $_GET);
259
-
$this->assertSame(['code' => 'good'], $_REQUEST); // @phpstan-ignore codeigniter.superglobalsOffsetAccess (checks the live superglobal, not the snapshot service)
$this->assertSame('get_value', $_REQUEST['get_key']); // @phpstan-ignore codeigniter.superglobalsOffsetAccess (checks the live superglobal, not the snapshot service)
0 commit comments