diff options
author | Matthew Grooms <mgrooms@pfsense.org> | 2008-09-09 21:08:58 +0000 |
---|---|---|
committer | Matthew Grooms <mgrooms@pfsense.org> | 2008-09-09 21:08:58 +0000 |
commit | 0a242e9dc5fdea23c34fbf45be0fa12c3a010800 (patch) | |
tree | ec0447b0ec8343fcfa3654cf8984660125f62874 /etc/inc | |
parent | b6dd249684e40d63636db99bd0489acec0aa4040 (diff) | |
download | pfsense-0a242e9dc5fdea23c34fbf45be0fa12c3a010800.zip pfsense-0a242e9dc5fdea23c34fbf45be0fa12c3a010800.tar.gz |
Add validation for the ca configuration array presence. Minor style fixes.
Diffstat (limited to 'etc/inc')
-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;
}
|