Page MenuHomePhabricator

D19726.id47135.diff
No OneTemporary

D19726.id47135.diff

Index: src/filesystem/Filesystem.php
===================================================================
--- src/filesystem/Filesystem.php
+++ src/filesystem/Filesystem.php
@@ -421,6 +421,12 @@
throw new Exception(pht('You must generate at least 1 byte of entropy.'));
}
+ // Under PHP7, the "random_bytes()" function provides a simpler and more
+ // portable way to accomplish what the rest of this function accomplishes.
+ if (function_exists('random_bytes')) {
+ return random_bytes($number_of_bytes);
+ }
+
// Try to use `openssl_random_pseudo_bytes()` if it's available. This source
// is the most widely available source, and works on Windows/Linux/OSX/etc.
@@ -481,7 +487,7 @@
pht(
'%s requires the PHP OpenSSL extension to be installed and enabled '.
'to access an entropy source. On Windows, this extension is usually '.
- 'installed but not enabled by default. Enable it in your "s".',
+ 'installed but not enabled by default. Enable it in your "php.ini".',
__METHOD__.'()',
'php.ini'));
}

File Metadata

Mime Type
text/plain
Expires
Sat, Apr 5, 11:27 AM (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7640523
Default Alt Text
D19726.id47135.diff (1 KB)

Event Timeline