From 8aecafc92fc229f50ec8f9d34ca272fbc6a73f2a Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sun, 21 Jan 2018 12:23:47 -0600 Subject: [PATCH] X509: fix 7.2 error when extensions were removed and new ones added --- phpseclib/File/X509.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/phpseclib/File/X509.php b/phpseclib/File/X509.php index ba04e08e..ab3bd2bf 100644 --- a/phpseclib/File/X509.php +++ b/phpseclib/File/X509.php @@ -2530,6 +2530,10 @@ class File_X509 } $dn = array_values($dn); + // fix for https://bugs.php.net/75433 affecting PHP 7.2 + if (!isset($dn[0])) { + $dn = array_splice($dn, 0, 0); + } } /** @@ -4166,6 +4170,10 @@ class File_X509 } $extensions = array_values($extensions); + // fix for https://bugs.php.net/75433 affecting PHP 7.2 + if (!isset($extensions[0])) { + $extensions = array_splice($extensions, 0, 0); + } return $result; }