Skip to content

Commit 64f947a

Browse files
committed
apply suggestions
1 parent cfb4ad3 commit 64f947a

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

system/Security/Security.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)