From 5ca13f69b79ab1e461e7a689d7d02a8c2c0794eb Mon Sep 17 00:00:00 2001 From: Ermal Date: Fri, 24 Jun 2011 12:10:51 +0000 Subject: Import error handling to avoid errors. --- etc/inc/certs.inc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'etc/inc/certs.inc') diff --git a/etc/inc/certs.inc b/etc/inc/certs.inc index 6ab448b..3f655b1 100644 --- a/etc/inc/certs.inc +++ b/etc/inc/certs.inc @@ -338,7 +338,7 @@ function csr_get_subject($str_crt, $decode = true) { $components = openssl_csr_get_subject($str_crt); - if (!is_array($components)) + if (empty($components) || !is_array($components)) return "unknown"; ksort($components); @@ -360,7 +360,7 @@ function cert_get_subject($str_crt, $decode = true) { $inf_crt = openssl_x509_parse($str_crt); $components = $inf_crt['subject']; - if (!is_array($components)) + if (empty($components) || !is_array($components)) return "unknown"; ksort($components); @@ -410,9 +410,10 @@ function cert_get_issuer($str_crt, $decode = true) { $inf_crt = openssl_x509_parse($str_crt); $components = $inf_crt['issuer']; - ksort($components); - if (!is_array($components)) + if (empty($components) || !is_array($components)) return "unknown"; + + ksort($components); foreach ($components as $a => $v) { if (!strlen($issuer)) $issuer = "{$a}={$v}"; -- cgit v1.1