Skip to content

Commit 1482a7e

Browse files
committed
fixed bug with missing new line in ssl certificate
1 parent fe1b3cf commit 1482a7e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

web/add/web/index.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,20 +182,23 @@
182182
if (!empty($_POST['v_ssl_crt'])) {
183183
$fp = fopen($tmpdir."/".$_POST['v_domain'].".crt", 'w');
184184
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_crt']));
185+
fwrite($fp, "\n");
185186
fclose($fp);
186187
}
187188

188189
// Key
189190
if (!empty($_POST['v_ssl_key'])) {
190191
$fp = fopen($tmpdir."/".$_POST['v_domain'].".key", 'w');
191192
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_key']));
193+
fwrite($fp, "\n");
192194
fclose($fp);
193195
}
194196

195197
// CA
196198
if (!empty($_POST['v_ssl_ca'])) {
197199
$fp = fopen($tmpdir."/".$_POST['v_domain'].".ca", 'w');
198200
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_ca']));
201+
fwrite($fp, "\n");
199202
fclose($fp);
200203
}
201204

web/edit/web/index.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,20 +272,23 @@
272272
if (!empty($_POST['v_ssl_crt'])) {
273273
$fp = fopen($tmpdir."/".$_POST['v_domain'].".crt", 'w');
274274
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_crt']));
275+
fwrite($fp, "\n");
275276
fclose($fp);
276277
}
277278

278279
// Key
279280
if (!empty($_POST['v_ssl_key'])) {
280281
$fp = fopen($tmpdir."/".$_POST['v_domain'].".key", 'w');
281282
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_key']));
283+
fwrite($fp, "\n");
282284
fclose($fp);
283285
}
284286

285287
// CA
286288
if (!empty($_POST['v_ssl_ca'])) {
287289
$fp = fopen($tmpdir."/".$_POST['v_domain'].".ca", 'w');
288290
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_ca']));
291+
fwrite($fp, "\n");
289292
fclose($fp);
290293
}
291294

0 commit comments

Comments
 (0)