1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00

Update safefilerewrite with PHP_EOL

This commit is contained in:
billz 2019-04-30 22:57:12 +00:00
parent 1008f83cc4
commit 3f9b422f5f

View File

@ -17,7 +17,7 @@ function write_php_ini($array, $file)
if (is_array($val)) { if (is_array($val)) {
$res[] = "[$key]"; $res[] = "[$key]";
foreach ($val as $skey => $sval) { foreach ($val as $skey => $sval) {
$res[] = "$skey = $val"; $res[] = "$skey = $sval";
} }
} else { } else {
$res[] = "$key = $val"; $res[] = "$key = $val";
@ -44,7 +44,7 @@ function safefilerewrite($fileName, $dataToSave)
//file was locked so now we can store information //file was locked so now we can store information
if ($canWrite) { if ($canWrite) {
fwrite($fp, $dataToSave); fwrite($fp, $dataToSave.PHP_EOL);
flock($fp, LOCK_UN); flock($fp, LOCK_UN);
} }
fclose($fp); fclose($fp);