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
325325 } else {
326326 $ body = $ request ->getBody () ?? '' ;
327327 $ json = json_decode ($ body );
328- if (! empty ( $ json) && json_last_error () === JSON_ERROR_NONE ) {
328+ if ($ json !== null && json_last_error () === JSON_ERROR_NONE ) {
329329 // We kill this since we're done and we don't want to pollute the JSON data.
330330 unset($ json ->{$ this ->config ->tokenName });
331331 $ request ->setBody (json_encode ($ json ));
@@ -356,7 +356,7 @@ private function getPostedToken(RequestInterface $request): ?string
356356
357357 if ($ body !== '' ) {
358358 $ json = json_decode ($ body );
359- if (! empty ( $ json) && json_last_error () === JSON_ERROR_NONE ) {
359+ if ($ json !== null && json_last_error () === JSON_ERROR_NONE ) {
360360 return $ json ->{$ this ->config ->tokenName } ?? null ;
361361 }
362362
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:
2062063. ``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
2072074. ``php://input `` (raw body) - for PUT, PATCH, and DELETE type of requests
208208
209+ .. note :: ``php://input`` (raw body) is checked since v4.4.2.
210+
209211*********************
210212Other Helpful Methods
211213*********************
You can’t perform that action at this time.
0 commit comments