From 546f30caee9165f253d9ed3d84e23f03e82626d8 Mon Sep 17 00:00:00 2001 From: jim-p Date: Fri, 14 Jan 2011 12:20:16 -0500 Subject: Better test for an empty CA to avoid writing out an empty CA file (some on the forum are seeing this.) --- etc/inc/system.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/inc/system.inc b/etc/inc/system.inc index bdd8157..296c4f2 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -1070,7 +1070,7 @@ EOD; fwrite($fd, "\n"); fwrite($fd, $key); fclose($fd); - if($ca <> "") { + if(!(empty($ca) || (strlen(trim($ca)) == 0))) { $fd = fopen("{$g['varetc_path']}/{$ca_location}", "w"); if (!$fd) { printf("Error: cannot open ca.pem in system_webgui_start().\n"); @@ -1084,7 +1084,7 @@ EOD; $lighty_config .= "## ssl configuration\n"; $lighty_config .= "ssl.engine = \"enable\"\n"; $lighty_config .= "ssl.pemfile = \"{$g['varetc_path']}/{$cert_location}\"\n\n"; - if($ca <> "") + if(!(empty($ca) || (strlen(trim($ca)) == 0))) { $lighty_config .= "ssl.ca-file = \"{$g['varetc_path']}/{$ca_location}\"\n\n"; } -- cgit v1.1