diff options
-rw-r--r-- | etc/inc/certs.inc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/etc/inc/certs.inc b/etc/inc/certs.inc index b4d3dc0..b7c0e60 100644 --- a/etc/inc/certs.inc +++ b/etc/inc/certs.inc @@ -33,9 +33,10 @@ require_once("functions.inc"); function & lookup_ca($refid) {
global $config;
- foreach ($config['system']['ca'] as & $ca)
- if ($ca['refid'] == $refid)
- return $ca;
+ if (is_array($config['system']['ca']))
+ foreach ($config['system']['ca'] as & $ca)
+ if ($ca['refid'] == $refid)
+ return $ca;
return false;
}
@@ -43,13 +44,11 @@ function & lookup_ca($refid) { function & lookup_cert($refid) {
global $config;
- if(is_array($config['system']['cert'])) {
- foreach ($config['system']['cert'] as & $cert) {
- if ($cert['refid'] == $refid) {
+ if (is_array($config['system']['cert']))
+ foreach ($config['system']['cert'] as & $cert)
+ if ($cert['refid'] == $refid)
return $cert;
- }
- }
- }
+
return false;
}
|