CodeIgniter4 icon indicating copy to clipboard operation
CodeIgniter4 copied to clipboard

fix: populateGlobals for JSON and XML body format

Open michalsn opened this issue 1 year ago • 0 comments

Description This PR fixes a bug in the populateGlobals() method in the FeatureTestTrait class. If the body format is set to json or xml, we should not use setGlobal() for post requests. The POST array should be empty since the data is stored in the raw input stream.

I think this is the proper way to solve the problem, although if anyone sees any issues, feedback is welcome (as always).

Closes #9204

Checklist:

  • [x] Securely signed commits
  • [x] Component(s) with PHPDoc blocks, only if necessary or adds value
  • [x] Unit testing, with >80% coverage
  • [ ] User guide updated
  • [x] Conforms to style guide

michalsn avatar Oct 02 '24 13:10 michalsn