Skip to content

Commit

Permalink
修正sessionid检查的一处隐患
Browse files Browse the repository at this point in the history
  • Loading branch information
yunwuxin committed Jan 10, 2020
1 parent a30ecc0 commit 1bbe750
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/think/session/Store.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function getName(): string
*/
public function setId($id = null): void
{
$this->id = is_string($id) && strlen($id) === 32 ? $id : md5(microtime(true) . session_create_id());
$this->id = is_string($id) && strlen($id) === 32 && ctype_alnum($id) ? $id : md5(microtime(true) . session_create_id());
}

/**
Expand Down

0 comments on commit 1bbe750

Please sign in to comment.