mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-16 18:25:13 +00:00
Replace extension_loaded with forward compatible function exists check
This commit is contained in:
parent
58768cb5aa
commit
b3add4491d
@ -1257,7 +1257,7 @@ class SSH2
|
|||||||
$identifier = 'SSH-2.0-phpseclib_2.0';
|
$identifier = 'SSH-2.0-phpseclib_2.0';
|
||||||
|
|
||||||
$ext = array();
|
$ext = array();
|
||||||
if (extension_loaded('libsodium')) {
|
if (function_exists('\\Sodium\\library_version_major')) {
|
||||||
$ext[] = 'libsodium';
|
$ext[] = 'libsodium';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ class Unit_Net_SSH2Test extends PhpseclibTestCase
|
|||||||
$identifier = $this->createSSHMock()->_generate_identifier();
|
$identifier = $this->createSSHMock()->_generate_identifier();
|
||||||
$this->assertStringStartsWith('SSH-2.0-phpseclib_2.0', $identifier);
|
$this->assertStringStartsWith('SSH-2.0-phpseclib_2.0', $identifier);
|
||||||
|
|
||||||
if (extension_loaded('libsodium')) {
|
if (function_exists('\\Sodium\\library_version_major')) {
|
||||||
$this->assertContains('libsodium', $identifier);
|
$this->assertContains('libsodium', $identifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user