Repository navigation
Conversation
Several 5.x changes add entries to docs/v4-to-v5-update.md; creating the file once keeps them from conflicting over its creation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Json declared its own getRaw() returning the raw request body, which
shadowed the getRaw($name, $default) shorthand of every other input. It is
replaced by getRawBody(), so getRaw('field') returns the unfiltered value.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
Jsondeclares its owngetRaw()that returns the raw request body, so thegetRaw($name, $default)shorthand that every other input has (via__call()) does not work on$input->json:getRaw('field')ignores its arguments. #60 (4.x) addsgetRawBody(), makesgetRaw('field')return the unfiltered value and deprecates callinggetRaw()without a name. This is the 5.0 step: the request-bodygetRaw()is removed, sogetRaw()onJsonis the regular shorthand, and the body is read withgetRawBody().Depends on #60 for the 4.x deprecation, and on #65 (update guide); this branch contains #65's commit until it is merged.
When 4.x-dev is merged up: #60 rewrites
getRaw()and addsgetRawBody()in the same place. Keep this PR's version (nogetRaw()override,getRawBody()only); drop #60'stestGetRawWithoutNameIsDeprecated(). With #66 merged, givegetRawBody()the native return type it already has here. #61 rewrites theJsonTestbody tests to a stream wrapper;testGetRawBody()here then needs the same treatment (it still usesHTTP_RAW_POST_DATA, which #61 removes).Testing Instructions
JsonTest::testgetRaw()is renamedtestGetRawBody()and reads the body throughgetRawBody(); the newtestGetRaw()checks thatgetRaw('field')returns the unfiltered value. Both fail before the change and pass after it.Documentation Changes Required
docs/overview.md("JSON bodies"):getRaw('title')andgetRawBody().docs/v4-to-v5-update.md: new section with the migration.Depends on #60
Depends on #65
🤖 Generated with Claude Code