1
0
mirror of https://github.com/danog/phpseclib.git synced 2024-12-02 17:52:59 +01:00

BigInteger: tweak to the phpinfo checks

This commit is contained in:
terrafrost 2022-04-26 08:54:19 -05:00
parent 59481054df
commit c22bf62ce1

View File

@ -257,7 +257,10 @@ class Math_BigInteger
}
}
if (function_exists('phpinfo') && extension_loaded('openssl') && !defined('MATH_BIGINTEGER_OPENSSL_DISABLE') && !defined('MATH_BIGINTEGER_OPENSSL_ENABLED')) {
if (extension_loaded('openssl') && !defined('MATH_BIGINTEGER_OPENSSL_DISABLE') && !defined('MATH_BIGINTEGER_OPENSSL_ENABLED')) {
$versions = array();
if (function_exists('phpinfo')) {
// some versions of XAMPP have mismatched versions of OpenSSL which causes it not to work
ob_start();
@phpinfo();
@ -266,7 +269,6 @@ class Math_BigInteger
preg_match_all('#OpenSSL (Header|Library) Version(.*)#im', $content, $matches);
$versions = array();
if (!empty($matches[1])) {
for ($i = 0; $i < count($matches[1]); $i++) {
$fullVersion = trim(str_replace('=>', '', strip_tags($matches[2][$i])));
@ -279,6 +281,7 @@ class Math_BigInteger
}
}
}
}
// it doesn't appear that OpenSSL versions were reported upon until PHP 5.3+
switch (true) {