diff --git a/phpseclib/File/X509.php b/phpseclib/File/X509.php index 5f1f5b68..fa67bb1c 100644 --- a/phpseclib/File/X509.php +++ b/phpseclib/File/X509.php @@ -311,7 +311,7 @@ class X509 * @var int * @access private */ - var $recur_limit = 5; + static $recur_limit = 5; /** * Default Constructor. @@ -2119,7 +2119,7 @@ class X509 * @access private * @return bool|string */ - function _fetchURL($url) + static function _fetchURL($url) { $parts = parse_url($url); $data = ''; @@ -2189,7 +2189,7 @@ class X509 return false; } - $cert = $this->_fetchURL($url); + $cert = static::_fetchURL($url); if (!is_string($cert)) { return false; } @@ -2255,7 +2255,7 @@ class X509 return null; } - if ($count == $this->recur_limit) { + if ($count == self::$recur_limit) { return false; } @@ -2424,9 +2424,9 @@ class X509 * @param int $count * @access public */ - function setRecurLimit($count) + static function setRecurLimit($count) { - $this->recur_limit = $count; + self::$recur_limit = $count; } /** diff --git a/tests/Unit/File/X509/X509Test.php b/tests/Unit/File/X509/X509Test.php index 261d3e42..3e92d0c9 100644 --- a/tests/Unit/File/X509/X509Test.php +++ b/tests/Unit/File/X509/X509Test.php @@ -640,7 +640,7 @@ Fqfy+n5VpXOdrjic4yZ52yS5sUaq05s6ZZvnmdU= public function testAuthorityInfoAccess() { - $x509 = new File_X509(); + $x509 = new X509(); $x509->loadCA('-----BEGIN CERTIFICATE----- MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 @@ -703,10 +703,10 @@ lV66p3Ui7pFABGc/Lv7nOyANXfLugBO8MyzydGA4NRGiS2MbGpswPCg154pWausU M0qaEPsM2o3CSTfxSJQQIyEe+izV3UQqYSyWkNqCCFPN -----END CERTIFICATE-----'); - $x509->setRecurLimit(0); + X509::setRecurLimit(0); $this->assertFalse($x509->validateSignature()); - $x509->setRecurLimit(5); + X509::setRecurLimit(5); $this->assertTrue($x509->validateSignature()); } }