diff --git a/phpseclib/Crypt/RSA.php b/phpseclib/Crypt/RSA.php index afe6ceb6..07b8575d 100644 --- a/phpseclib/Crypt/RSA.php +++ b/phpseclib/Crypt/RSA.php @@ -81,7 +81,9 @@ if (!class_exists('Math_BigInteger')) { */ // the class_exists() will only be called if the crypt_random function hasn't been defined and // will trigger a call to __autoload() if you're wanting to auto-load classes -if (!function_exists('crypt_random') && !class_exists('Crypt_Random')) { +// call function_exists() a second time to stop the require_once from being called outside +// of the auto loader +if (!function_exists('crypt_random') && !class_exists('Crypt_Random') && !function_exists('crypt_random')) { require_once('Crypt/Random.php'); } diff --git a/phpseclib/Net/SSH1.php b/phpseclib/Net/SSH1.php index 665b6989..69669aa7 100644 --- a/phpseclib/Net/SSH1.php +++ b/phpseclib/Net/SSH1.php @@ -106,7 +106,9 @@ if (!class_exists('Crypt_RC4')) { */ // the class_exists() will only be called if the crypt_random function hasn't been defined and // will trigger a call to __autoload() if you're wanting to auto-load classes -if (!function_exists('crypt_random') && !class_exists('Crypt_Random')) { +// call function_exists() a second time to stop the require_once from being called outside +// of the auto loader +if (!function_exists('crypt_random') && !class_exists('Crypt_Random') && !function_exists('crypt_random')) { require_once('Crypt/Random.php'); } diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 4caa9bc4..3a7c330d 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -82,7 +82,9 @@ if (!class_exists('Math_BigInteger')) { */ // the class_exists() will only be called if the crypt_random function hasn't been defined and // will trigger a call to __autoload() if you're wanting to auto-load classes -if (!function_exists('crypt_random') && !class_exists('Crypt_Random')) { +// call function_exists() a second time to stop the require_once from being called outside +// of the auto loader +if (!function_exists('crypt_random') && !class_exists('Crypt_Random') && !function_exists('crypt_random')) { require_once('Crypt/Random.php'); }