File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
user_guide_src/source/libraries Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -325,7 +325,7 @@ private function removeTokenInRequest(RequestInterface $request): void
325
325
} else {
326
326
$ body = $ request ->getBody () ?? '' ;
327
327
$ json = json_decode ($ body );
328
- if (! empty ( $ json) && json_last_error () === JSON_ERROR_NONE ) {
328
+ if ($ json !== null && json_last_error () === JSON_ERROR_NONE ) {
329
329
// We kill this since we're done and we don't want to pollute the JSON data.
330
330
unset($ json ->{$ this ->config ->tokenName });
331
331
$ request ->setBody (json_encode ($ json ));
@@ -356,7 +356,7 @@ private function getPostedToken(RequestInterface $request): ?string
356
356
357
357
if ($ body !== '' ) {
358
358
$ json = json_decode ($ body );
359
- if (! empty ( $ json) && json_last_error () === JSON_ERROR_NONE ) {
359
+ if ($ json !== null && json_last_error () === JSON_ERROR_NONE ) {
360
360
return $ json ->{$ this ->config ->tokenName } ?? null ;
361
361
}
362
362
Original file line number Diff line number Diff line change @@ -206,6 +206,8 @@ The order of checking the availability of the CSRF token is as follows:
206
206
3. ``php://input `` (JSON request) - bear in mind that this approach is the slowest one since we have to decode JSON and then re-encode it
207
207
4. ``php://input `` (raw body) - for PUT, PATCH, and DELETE type of requests
208
208
209
+ .. note :: ``php://input`` (raw body) is checked since v4.4.2.
210
+
209
211
*********************
210
212
Other Helpful Methods
211
213
*********************
You can’t perform that action at this time.
0 commit comments