From cce21f077fb73ab9eb511ae6d7ae31e3f77fae43 Mon Sep 17 00:00:00 2001 From: Bastien Miclo Date: Thu, 7 Jan 2021 22:05:17 +0100 Subject: [PATCH] Allow to pass end date as DateTime --- phpseclib/File/X509.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpseclib/File/X509.php b/phpseclib/File/X509.php index 874bcb11..ba6a0481 100644 --- a/phpseclib/File/X509.php +++ b/phpseclib/File/X509.php @@ -3061,7 +3061,7 @@ class X509 -- http://tools.ietf.org/html/rfc5280#section-4.1.2.5 */ - if (strtolower($date) == 'lifetime') { + if (is_string($date) && strtolower($date) === 'lifetime') { $temp = '99991231235959Z'; $temp = chr(ASN1::TYPE_GENERALIZED_TIME) . ASN1::encodeLength(strlen($temp)) . $temp; $this->endDate = new Element($temp);