We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 74ca5ad commit e599ecfCopy full SHA for e599ecf
tests/RedisTest.php
@@ -5461,8 +5461,17 @@ private function generateSessionId()
5461
{
5462
if (function_exists('session_create_id')) {
5463
return session_create_id();
5464
+ } else if (function_exists('random_bytes')) {
5465
+ return bin2hex(random_bytes(8));
5466
+ } else if (function_exists('openssl_random_pseudo_bytes')) {
5467
+ return bin2hex(openssl_random_pseudo_bytes(8));
5468
} else {
- $encoded = bin2hex(openssl_random_pseudo_bytes(8));
5469
+ /* Not cryptographically secure, but it doesn't need to be
5470
+ * for the test. We just want an ID */
5471
+ $encoded = '';
5472
+ for ($c = 0; $c < 8; $c++) {
5473
+ $encoded .= chr(rand(65, 90));
5474
+ }
5475
return $encoded;
5476
}
5477
0 commit comments