From 29202c918fa5a2f5a90e532a6c17cf1793b75cd0 Mon Sep 17 00:00:00 2001
From: ftimme <ft@falkotimme.com>
Date: Mon, 09 Jan 2012 18:24:11 -0500
Subject: [PATCH] - nginx plugin: fixed newlines in .crt file when bundle cert is added.

---
 server/plugins-available/nginx_plugin.inc.php |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/plugins-available/nginx_plugin.inc.php b/server/plugins-available/nginx_plugin.inc.php
index a33abfa..79fa68d 100644
--- a/server/plugins-available/nginx_plugin.inc.php
+++ b/server/plugins-available/nginx_plugin.inc.php
@@ -198,7 +198,7 @@
 			if(trim($data["new"]["ssl_request"]) != '') file_put_contents($csr_file,$data["new"]["ssl_request"]);
 			if(trim($data["new"]["ssl_cert"]) != '') file_put_contents($crt_file,$data["new"]["ssl_cert"]);
 			// for nginx, bundle files have to be appended to the certificate file
-			if(trim($data["new"]["ssl_bundle"]) != ''){
+			if(trim($data["new"]["ssl_bundle"]) != ''){				
 				if(file_exists($crt_file)){
 					$crt_file_contents = trim(file_get_contents($crt_file));
 				} else {
@@ -206,7 +206,7 @@
 				}
 				if($crt_file_contents != '') $crt_file_contents .= "\n";
 				$crt_file_contents .= $data["new"]["ssl_bundle"];
-				file_put_contents($crt_file,$crt_file_contents);
+				file_put_contents($crt_file,$app->file->unix_nl($crt_file_contents));
 				unset($crt_file_contents);
 			}
 			/* Update the DB of the (local) Server */

--
Gitblit v1.9.1