File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -298,20 +298,18 @@ private function removeTokenInRequest(IncomingRequest $request): void
298298 $ json = null ;
299299 }
300300
301- if (is_object ($ json ) && property_exists ($ json , $ tokenName )) {
302- unset($ json ->{$ tokenName });
303- $ request ->setBody (json_encode ($ json ));
301+ if (is_object ($ json )) {
302+ if (property_exists ($ json , $ tokenName )) {
303+ unset($ json ->{$ tokenName });
304+ $ request ->setBody (json_encode ($ json ));
305+ }
304306
305307 return ;
306308 }
307309
308310 // If the token is found in form-encoded data, we can safely remove it.
309311 parse_str ($ body , $ result );
310312
311- if (! array_key_exists ($ tokenName , $ result )) {
312- return ;
313- }
314-
315313 unset($ result [$ tokenName ]);
316314 $ request ->setBody (http_build_query ($ result ));
317315 }
You can’t perform that action at this time.
0 commit comments