diff options
author | Cameron Eagans <me@cweagans.net> | 2015-10-09 10:57:40 -0600 |
---|---|---|
committer | Scott <scott@paragonie.com> | 2015-10-15 13:55:21 -0400 |
commit | 602bf2a9a7592cfcc193fa55dd3f622d993f3f9c (patch) | |
tree | dc1d59c9458e451a3552a93de57e28bc71b5c45b | |
parent | 9666400fe433f583592f8c26a6f3a599cd72eb58 (diff) | |
download | random_compat-602bf2a9a7592cfcc193fa55dd3f622d993f3f9c.zip random_compat-602bf2a9a7592cfcc193fa55dd3f622d993f3f9c.tar.gz random_compat-602bf2a9a7592cfcc193fa55dd3f622d993f3f9c.tar.bz2 |
Use extension_loaded() instead of checking that a function exists.
-rw-r--r-- | lib/random.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/random.php b/lib/random.php index 1530f7e..45b1de2 100644 --- a/lib/random.php +++ b/lib/random.php @@ -55,13 +55,13 @@ if (PHP_VERSION_ID < 70000) { if (!ini_get('open_basedir') && is_readable('/dev/urandom')) { // See random_bytes_dev_urandom.php require_once "random_bytes_dev_urandom.php"; - } elseif (PHP_VERSION_ID >= 50307 && function_exists('mcrypt_create_iv')) { + } elseif (PHP_VERSION_ID >= 50307 && extension_loaded('mcrypt')) { // See random_bytes_mcrypt.php require_once "random_bytes_mcrypt.php"; } elseif (extension_loaded('com_dotnet')) { // See random_bytes_com_dotnet.php require_once "random_bytes_com_dotnet.php"; - } elseif (function_exists('openssl_random_pseudo_bytes')) { + } elseif (extension_loaded('openssl')) { // See random_bytes_openssl.php require_once "random_bytes_openssl.php"; } else { |