Просмотр исходного кода

fixed bug with missing new line in ssl certificate

Serghey Rodin 13 лет назад
Родитель
Сommit
1482a7e8fd
2 измененных файлов с 6 добавлено и 0 удалено
  1. 3 0
      web/add/web/index.php
  2. 3 0
      web/edit/web/index.php

+ 3 - 0
web/add/web/index.php

@@ -182,6 +182,7 @@ top_panel($user,$TAB);
                 if (!empty($_POST['v_ssl_crt'])) {
                 if (!empty($_POST['v_ssl_crt'])) {
                     $fp = fopen($tmpdir."/".$_POST['v_domain'].".crt", 'w');
                     $fp = fopen($tmpdir."/".$_POST['v_domain'].".crt", 'w');
                     fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_crt']));
                     fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_crt']));
+                    fwrite($fp, "\n");
                     fclose($fp);
                     fclose($fp);
                 }
                 }
 
 
@@ -189,6 +190,7 @@ top_panel($user,$TAB);
                 if (!empty($_POST['v_ssl_key'])) {
                 if (!empty($_POST['v_ssl_key'])) {
                     $fp = fopen($tmpdir."/".$_POST['v_domain'].".key", 'w');
                     $fp = fopen($tmpdir."/".$_POST['v_domain'].".key", 'w');
                     fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_key']));
                     fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_key']));
+                    fwrite($fp, "\n");
                     fclose($fp);
                     fclose($fp);
                 }
                 }
 
 
@@ -196,6 +198,7 @@ top_panel($user,$TAB);
                 if (!empty($_POST['v_ssl_ca'])) {
                 if (!empty($_POST['v_ssl_ca'])) {
                     $fp = fopen($tmpdir."/".$_POST['v_domain'].".ca", 'w');
                     $fp = fopen($tmpdir."/".$_POST['v_domain'].".ca", 'w');
                     fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_ca']));
                     fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_ca']));
+                    fwrite($fp, "\n");
                     fclose($fp);
                     fclose($fp);
                 }
                 }
 
 

+ 3 - 0
web/edit/web/index.php

@@ -272,6 +272,7 @@ top_panel($user,$TAB);
                 if (!empty($_POST['v_ssl_crt'])) {
                 if (!empty($_POST['v_ssl_crt'])) {
                     $fp = fopen($tmpdir."/".$_POST['v_domain'].".crt", 'w');
                     $fp = fopen($tmpdir."/".$_POST['v_domain'].".crt", 'w');
                     fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_ssl_crt']));
                     fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_ssl_crt']));
+                    fwrite($fp, "\n");
                     fclose($fp);
                     fclose($fp);
                 }
                 }
 
 
@@ -279,6 +280,7 @@ top_panel($user,$TAB);
                 if (!empty($_POST['v_ssl_key'])) {
                 if (!empty($_POST['v_ssl_key'])) {
                     $fp = fopen($tmpdir."/".$_POST['v_domain'].".key", 'w');
                     $fp = fopen($tmpdir."/".$_POST['v_domain'].".key", 'w');
                     fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_key']));
                     fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_key']));
+                    fwrite($fp, "\n");
                     fclose($fp);
                     fclose($fp);
                 }
                 }
 
 
@@ -286,6 +288,7 @@ top_panel($user,$TAB);
                 if (!empty($_POST['v_ssl_ca'])) {
                 if (!empty($_POST['v_ssl_ca'])) {
                     $fp = fopen($tmpdir."/".$_POST['v_domain'].".ca", 'w');
                     $fp = fopen($tmpdir."/".$_POST['v_domain'].".ca", 'w');
                     fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_ca']));
                     fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_ca']));
+                    fwrite($fp, "\n");
                     fclose($fp);
                     fclose($fp);
                 }
                 }