We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cfb4ad3 commit 64f947aCopy full SHA for 64f947a
1 file changed
system/Security/Security.php
@@ -298,20 +298,18 @@ private function removeTokenInRequest(IncomingRequest $request): void
298
$json = null;
299
}
300
301
- if (is_object($json) && property_exists($json, $tokenName)) {
302
- unset($json->{$tokenName});
303
- $request->setBody(json_encode($json));
+ if (is_object($json)) {
+ if (property_exists($json, $tokenName)) {
+ unset($json->{$tokenName});
304
+ $request->setBody(json_encode($json));
305
+ }
306
307
return;
308
309
310
// If the token is found in form-encoded data, we can safely remove it.
311
parse_str($body, $result);
312
- if (! array_key_exists($tokenName, $result)) {
- return;
313
- }
314
-
315
unset($result[$tokenName]);
316
$request->setBody(http_build_query($result));
317
0 commit comments