Skip to content

Commit 1ed2ad4

Browse files
committed
Update SaveHandler::validateId method
1 parent e3493a8 commit 1ed2ad4

1 file changed

Lines changed: 1 addition & 12 deletions

File tree

src/SaveHandler.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -211,18 +211,7 @@ protected function getKeySuffix() : string
211211
*/
212212
public function validateId($id) : bool
213213
{
214-
if (\PHP_VERSION_ID >= 80400) {
215-
return (bool) \preg_match('#\A[0-9a-f]{32}\z#', $id);
216-
}
217-
$bits = \ini_get('session.sid_bits_per_character') ?: 5;
218-
$length = \ini_get('session.sid_length') ?: 40;
219-
$bitsRegex = [
220-
4 => '[0-9a-f]',
221-
5 => '[0-9a-v]',
222-
6 => '[0-9a-zA-Z,-]',
223-
];
224-
return isset($bitsRegex[$bits])
225-
&& \preg_match('#\A' . $bitsRegex[$bits] . '{' . $length . '}\z#', $id);
214+
return (bool) \preg_match('#\A[0-9a-f]{32}\z#', $id);
226215
}
227216

228217
/**

0 commit comments

Comments
 (0)