Skip to content

Commit 04041d3

Browse files
StreloxFrank Stuckenberg
andauthored
Docs: Fix state check example if session variable is not set (#946)
Co-authored-by: Frank Stuckenberg <f.stuckenberg@gastronovi.com>
1 parent d4bcb32 commit 04041d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ if (!isset($_GET['code'])) {
4747
exit;
4848

4949
// Check given state against previously stored one to mitigate CSRF attack
50-
} elseif (empty($_GET['state']) || (isset($_SESSION['oauth2state']) && $_GET['state'] !== $_SESSION['oauth2state'])) {
50+
} elseif (empty($_GET['state']) || empty($_SESSION['oauth2state']) || $_GET['state'] !== $_SESSION['oauth2state']) {
5151

5252
if (isset($_SESSION['oauth2state'])) {
5353
unset($_SESSION['oauth2state']);

0 commit comments

Comments
 (0)