From b6dd249684e40d63636db99bd0489acec0aa4040 Mon Sep 17 00:00:00 2001 From: Seth Mos Date: Tue, 9 Sep 2008 21:03:22 +0000 Subject: [PATCH] Add validation --- etc/inc/certs.inc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/etc/inc/certs.inc b/etc/inc/certs.inc index f004abf441..b4d3dc0eb4 100644 --- a/etc/inc/certs.inc +++ b/etc/inc/certs.inc @@ -43,10 +43,13 @@ function & lookup_ca($refid) { function & lookup_cert($refid) { global $config; - foreach ($config['system']['cert'] as & $cert) - if ($cert['refid'] == $refid) - return $cert; - + if(is_array($config['system']['cert'])) { + foreach ($config['system']['cert'] as & $cert) { + if ($cert['refid'] == $refid) { + return $cert; + } + } + } return false; }