From 64c95322368fa309bcfca78073bcd5878f6ee212 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 19 Oct 2009 13:53:07 -0400 Subject: Do not show blank lines --- config/stunnel/stunnel.inc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'config/stunnel') diff --git a/config/stunnel/stunnel.inc b/config/stunnel/stunnel.inc index 62558e34..b7b4e18e 100644 --- a/config/stunnel/stunnel.inc +++ b/config/stunnel/stunnel.inc @@ -23,14 +23,18 @@ if(!isset($_GET['id']) and !isset($_POST['id']) and $num_certs) { $cert=$certs[$i]; $_info=openssl_x509_parse(base64_decode($cert['cert_chain'])); $valid=floor(($_info['validTo_time_t']-time())/86400); - if(!openssl_x509_check_private_key(base64_decode($cert['cert_chain']), base64_decode($cert['cert_key']))) { - $_status='Invalid key/cert!'; - } elseif($valid<30) { - $_status='Expires in '.$valid.' days!'; + if($cert['cert_chain']) { + if(!openssl_x509_check_private_key(base64_decode($cert['cert_chain']), base64_decode($cert['cert_key']))) { + $_status='Invalid key/cert!'; + } elseif($valid<30) { + $_status='Expires in '.$valid.' days!'; + } else { + $_status='OK ('.$valid.' days)'; + } + $config['installedpackages']['stunnelcerts']['config'][$i]['status']=$_status; } else { - $_status='OK ('.$valid.' days)'; + unset($config['installedpackages']['stunnelcerts']['config'][$i]); } - $config['installedpackages']['stunnelcerts']['config'][$i]['status']=$_status; } } -- cgit v1.2.3